Link to home
Start Free TrialLog in
Avatar of Gandharva_Guy
Gandharva_Guy

asked on

Hyper-v assigns auto-configuration IP for virtual network

Hi...

My server has two static IPs (one NIC with two ports). When I create a virtual external network in Hyper-v manager (named External1) and assign it to port 1, it works until I reboot, at which point Windows assigns it an auto-configuration IP address in the 169 range and therefore I cannot connect to the server on it, nor can vm's connect outbound. If I assign External1 to port 2 it doesn't have a problem.

Note that both port 1 and 2 are statically configured. Port 1 has a default gateway and port 2 does not.

To fix it I have to delete External1 and reboot the server. Then I can connect again, but have no virtual network to use anymore. Another way to fix it is to delete External1 and set port 1 to DHCP which allows me to connect (so it's not a cabling issue) but I need the static IP.

Ideally I want a virtual network on each port (named External1 and External2) so that I can assign vm's to one or the other.

The server with this problem is part of a 2-node cluster. The partner server doesn't seem to have a problem and I have two virtual networks on it.

I also tried setting the 'alternate configuration' for port 1 to use the same static settings but it still keeps assigning the auto-config IP.

Server is running Win2008 R2 SP1.

Any ideas?
Avatar of Svet Paperov
Svet Paperov
Flag of Canada image

Let see if I understand correctly: you set a static IP address on a NIC and it converts to dynamic within 169 subnet when you restart. Is that happens also if you remove the virtual NIC associated with that adapter (port 1
Avatar of Gandharva_Guy
Gandharva_Guy

ASKER

No it doesn't. If I remove the associated virtual network (using Hyper-v network manager), and then reboot, port 1 goes back to the static settings. It's only after I add a virtual network that this happens.
This is weird. You could try to rename the newly created share external virtual network when you recreate it with Virtual network manager in case there are some errors in the registry associated with this controller. May be it will help.

Another solution is to search the registry for some errors in Parameters\Tcpip keys.
Ok, I tried creating a network named 'dev1'...same problem.

Then I looked in the registry and saw that there are two key sets for the IP (the other server is also like this so I assume it's expected to have two). One set had two default gateways and EnableDHCP was set to 1. I corrected both (one default gateway, DHCP set to 0) so that the two key sets are identical. Rebooted and registry was still ok. Then I went to the IPv4 settings of the NIC and still looked ok, but when I pressed Ok it gave me a warning about multiple default gateways. I checked the registry and the two keys that I fixed were back to incorrect values.

Local Machine\System\CurrentControlSet\services\{long NIC id}\Parameters\Tcpip

So it seems that settings sheet is pushing incorrect values to the registry even though they are correct on the screen. Why?
ASKER CERTIFIED SOLUTION
Avatar of Gandharva_Guy
Gandharva_Guy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nice to hear. Thank you for the feedback.
Assistance from other expert led me to the detailed solution.