Hyper-v assigns auto-configuration IP for virtual network

Posted on 2011-05-03
Last Modified: 2012-06-21

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?
Question by:Gandharva_Guy
    LVL 20

    Expert Comment

    by:Svet Paperov
    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

    Author Comment

    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.
    LVL 20

    Expert Comment

    by:Svet Paperov
    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.

    Author Comment

    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?

    Accepted Solution

    Ok, I think found the issue. When I examined the registry more closely I found that there were some leftover settings  from when we initially tried to connect the server to the network (and ran into problems at that time). We ended up changing the NIC were were using and settings from that NIC seemed to be left over in the registry.

    In particular I looked at:


    for the corresponding NIC and noticed that there were multiple incorrect default gateways and EnableDHCP was set to 1. I corrected the gateways to have just one (with the correct IP) and set EnableDHCP to 0.

    Then I made the corresponding changes on:


    where {GUID} is the corresponding NIC (based on the IP).

    I also set the IP of the original NIC to and disabled it.

    Rebooted and all settings stayed correct.
    Added virtual networks back in and rebooted. All seems to be working now.

    LVL 20

    Expert Comment

    by:Svet Paperov
    Nice to hear. Thank you for the feedback.

    Author Closing Comment

    Assistance from other expert led me to the detailed solution.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    For Backups Guest OS files and indexing(and application awareness), Veeam needs Admin rights in Guest OS(Windows and Linux). In Windows a Domain Administrator account, and in Linux root access to perform this type of Backups and also Restore.
    The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
    This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
    This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now