Windows Server TechCenter > Windows Server Forums > Hyper-V > Help configuring static IPs using dual port NIC on Hyper V
Ask a questionAsk a question
 

AnswerHelp configuring static IPs using dual port NIC on Hyper V

  • Thursday, June 04, 2009 3:54 PMJCorbitt Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I'm a Hyper-V newbie with a question.  Our parent server: Dell 2950, Server 2008 Standard SP2, and Broadcom BCM5708C dual port NIC.  NIC port 1 is assigned a static IP for the parent server.

    I succesfully added the Hyper-V role, configured Hyper-V Manager, created a new virtual machine with Windows XP Pro SP3 32-bit, and configured an external virtual switch bound to a dedicated physical port on the parent server.

    I don't know how to configure the static IP on the second NIC.  We're not using DHCP or IPV6.  Should I assign an IP address to the second NIC on the parent server and a different IP address on guest adapter?

    I tried assigning a static NIC to the second NIC on the parent server and leaving the guest adapter DHCP.  This didn't work.  If I configure the parent server second NIC with DHCP IPV4, and assign and assign a static IP to the guest adapter, the guest has connectivity.

    Thanks for any help.

Answers

  • Wednesday, July 01, 2009 8:10 PMBrianEhMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    No problem..

    Q1 :
    Physical NIC 2 is bound to a Virtual Network Switch - it should not have an IP.  In fact, the virtual NIC that you disabled is the host connection to this Virtual Network Switch.  Thus preventing your Host from having two IP addresses on the same subnet (assuming both physical NICs are on the same physical network segment)

    Q2 :
    Yes, that would cause a duplicate IP address problem, and the chaos that will ensue.  In fact, the multi-homing situation of two insterfaces on the same network segment (two IP addresses in the same subnet) can cause problems of its own - dropped packets, unanswered pings, etc.

    Q3 :
    Considering your stated configuraiton for Physical NIC 2 - I am surprised that your VM is communicating over the network.  When a physical NIC is being used by a virtual network switch, the ONLY binding that you should have in the properties of that physical NIC is the virtual network switch protocol.


    This is what you should have if you look at Network Connections from the console of the Host:

    Physical NIC 1 (this is dedicated to the host, IP address assigned as you prefer, no virtual networks should use this NIC)
    Physical NIC 2 (this is dedicated to the Virtual Network switch, only binding should be the virtual network switch protocol)
    Virtual NIC  (this was created when the virtual network witch was created ( using the Virtual Network Manager ) and attached to the virtual network that uses physical NIC 2, this can safely be disabled)
    NIC of VM (this should be attached to the virtual network, IP address assigned as you desire).

    the most difficult thing about this is keeping the host physical network connections straight from the host virtual connections.


    Brian Ehlert (hopefully you have found this useful)
    • Marked As Answer byJCorbitt Wednesday, July 01, 2009 9:16 PM
    •  
  • Wednesday, July 01, 2009 8:38 PMBrianEhMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Summarizing: You only have two physical NICs, the recommended config is a dedicated management nic.
    Considering this...

    At this point in time I would do the following:

    1. Open Virtual Network manager and delete all virtual networks.
    2. Double check that each physical NIC is connected to the physical segment it should be.
    3. look in Network connections and verify that you only have two "Network Connections" (document their names, they should have all the Windows default properties - no strange or unusual settings or bindings) that represent your physical NICs
    4. return to Virtual Nework Manager and create an External virtual Network using NIC 2
    5. Note the new Network Adapter created in Network Connections (this is the one you need to disable)
    6. Modify the settings of your VM, selecting this new virtual Network.

    Basically, setting it all up again, but getting rid of any strage settings modifications and tweaks that might have been done at any point in time.

    If you have DHCP on your network, allow the VM to pick that up, just to verify traffic flows.

    Others have done this in the past and it has resulted in smoothing things out.




    Brian Ehlert (hopefully you have found this useful)
    • Marked As Answer byJCorbitt Wednesday, July 01, 2009 9:16 PM
    •  

All Replies

  • Thursday, June 04, 2009 4:18 PMPowerToTheUsers Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You have a dual port nic, so:
    Parent: NIC 1 => set the IP you want for the parent
    Parent: NIC 2 => don't configure anything, but select this NIC for the External virtual network. If you create this virtual network, you wel get an extra NIC on the parent: External vNIC.
                      => On this NIC, only "Microsoft Virtual Network Switch Protocol" will be enabled.
    Parent: External vNIC => don't configure anything, you can disable it as you're not going to use it.

    In the child you will see the NIC connected to the External Virtual Network. Here you can specify the static IP you want for that host.

    Kind Regards,
    PttU
  • Thursday, June 04, 2009 4:19 PMBrianEhMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    As was already stated, since you have a dedicated management NIC, simply disable the second Parent (Host) nic.

    This might help:
    http://itproctology.blogspot.com/2008/12/dedicating-physical-nic-for-management.html


    Brian Ehlert (hopefully you have found this useful)
  • Friday, June 05, 2009 2:31 AMVincent HuMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

     

    I agree with PowerToTheUsers,

     

    As you are a new to Hyper-V, I recommend that you have a read of the following articles about Hyper-V networking, it will be helpful for you.

     

    Understanding Networking with Hyper-V

    http://blogs.msdn.com/virtual_pc_guy/archive/2008/01/08/understanding-networking-with-hyper-v.aspx

     

    How does basic networking work in Hyper-V?

    http://blogs.technet.com/jhoward/archive/2008/06/16/how-does-basic-networking-work-in-hyper-v.aspx


    Configuring Virtual Networks

    http://technet.microsoft.com/en-us/library/cc816585.aspx
     

    Because you have two physical NICs, so it’s right to dedicate to physical NIC for Hyper-V host management.(Our best practice is to assign a dedicate NIC for host.) Please also have a read of the article provide by BrianEh.

     

    As you said, you assign the NIC 1 to the host, so you should create the External Virtual Networking bind to the second NIC(NIC 2), after that, you will have a new adapter appears in Network Connections, the name of this adapter should be Local Area Connection 3, the type should be Microsoft Virtual Network Switch Adapter. Because now the physical NIC 2 becomes to a switch for the VMs, so the system will spawn a virtual adapter for the host to communicate with the outside. As you have a dedicate physical NIC for host, so you can disable the virtual adapter for host.

     

     

    Best regards,

    Vincent Hu

  • Wednesday, July 01, 2009 7:32 PMJCorbitt Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thank you Vincent & Pttu.  I read the documentation referenced in your posts, and it was helpful.

    I would like to clarify what you recommended.

    This is my current configuration:

    Physical NIC 1
    -- Static IP
    -- Protocols enabled: Novell Client for Windows, Client for Microsoft Networks, QoS Packet Scheduler, File and Printer Sharing for Microsoft Networks, Internet Protocol Version 4 (configured with static IP), Link-Layer Topology Discovery Mapper I/O Driver, and Link-Layer Topology Discovery Responder

    Physical NIC 2
    -- Static IP
    ------Hyper V is bound to this NIC as an 'External' connection.
    ------I enabled IPv4 during testing and did not specify a static IP (configured for DHCP), and the Hyper V guest (and its applications) was/were accessible on the network
    ------I disabled IPv4 during testing, and the Hyper V guest (and its applications) was/were not accessible on the network.
    -- Protocols enabled: Microsoft Virtual Network Switch Protocol and Internet Protocol Version 4 (configured with static IP)

    Virtual NIC (on host)
    -- Disabled per your suggestion

    NIC on Hyper V guest (Windows XP Pro)
    -- Static IP
    -- Configured like any other XP device in our organization

    Everything is working well with this configuration.  I'm using 3 distinct IP address: one for NIC 1, one for NIC 2, and one for Hyper V guest NIC.

    Questions:

    1. Do I have to assign a static IP address to NIC2?  I'm not on a DHCP network; we don't have or need a DHCP server.
    2. Crazy question: Should the IP address for NIC2, if necessary, be the same as the Hyper V guest?  If so, won't that cause duplicate IP address errors?
    3. Is my current configuration correct?

    I don't mind having two IP addresses (NIC1 & NIC2), but is it ideal configuration?  Also, the host OS is trying to use both NICs for other apps.

    Thank you.
  • Wednesday, July 01, 2009 7:55 PMJCorbitt Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I don't know if my ealier post was clear in the beginning, but I have more questions about my current configuration.  I feel like this issue is almost resolved.  I appreciate your help.
  • Wednesday, July 01, 2009 8:10 PMBrianEhMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    No problem..

    Q1 :
    Physical NIC 2 is bound to a Virtual Network Switch - it should not have an IP.  In fact, the virtual NIC that you disabled is the host connection to this Virtual Network Switch.  Thus preventing your Host from having two IP addresses on the same subnet (assuming both physical NICs are on the same physical network segment)

    Q2 :
    Yes, that would cause a duplicate IP address problem, and the chaos that will ensue.  In fact, the multi-homing situation of two insterfaces on the same network segment (two IP addresses in the same subnet) can cause problems of its own - dropped packets, unanswered pings, etc.

    Q3 :
    Considering your stated configuraiton for Physical NIC 2 - I am surprised that your VM is communicating over the network.  When a physical NIC is being used by a virtual network switch, the ONLY binding that you should have in the properties of that physical NIC is the virtual network switch protocol.


    This is what you should have if you look at Network Connections from the console of the Host:

    Physical NIC 1 (this is dedicated to the host, IP address assigned as you prefer, no virtual networks should use this NIC)
    Physical NIC 2 (this is dedicated to the Virtual Network switch, only binding should be the virtual network switch protocol)
    Virtual NIC  (this was created when the virtual network witch was created ( using the Virtual Network Manager ) and attached to the virtual network that uses physical NIC 2, this can safely be disabled)
    NIC of VM (this should be attached to the virtual network, IP address assigned as you desire).

    the most difficult thing about this is keeping the host physical network connections straight from the host virtual connections.


    Brian Ehlert (hopefully you have found this useful)
    • Marked As Answer byJCorbitt Wednesday, July 01, 2009 9:16 PM
    •  
  • Wednesday, July 01, 2009 8:23 PMJCorbitt Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Brian,

    Regarding -- "Physical NIC 2 (this is dedicated to the Virtual Network switch, only binding should be the virtual network switch protocol)"

    If I disable everything but Virtual Network Switch protocol on NIC2, my guest VM is dead to the world.

    What do you think I'm doing incorrectly?

    Jeremy

  • Wednesday, July 01, 2009 8:37 PMBrian Borg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I would recommend leaving IP enabled on the virtual NIC.  Just make sure you don't enter a default gateway for it.  See:  2 nics- one for host & one for virtual machine.
  • Wednesday, July 01, 2009 8:38 PMBrianEhMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Summarizing: You only have two physical NICs, the recommended config is a dedicated management nic.
    Considering this...

    At this point in time I would do the following:

    1. Open Virtual Network manager and delete all virtual networks.
    2. Double check that each physical NIC is connected to the physical segment it should be.
    3. look in Network connections and verify that you only have two "Network Connections" (document their names, they should have all the Windows default properties - no strange or unusual settings or bindings) that represent your physical NICs
    4. return to Virtual Nework Manager and create an External virtual Network using NIC 2
    5. Note the new Network Adapter created in Network Connections (this is the one you need to disable)
    6. Modify the settings of your VM, selecting this new virtual Network.

    Basically, setting it all up again, but getting rid of any strage settings modifications and tweaks that might have been done at any point in time.

    If you have DHCP on your network, allow the VM to pick that up, just to verify traffic flows.

    Others have done this in the past and it has resulted in smoothing things out.




    Brian Ehlert (hopefully you have found this useful)
    • Marked As Answer byJCorbitt Wednesday, July 01, 2009 9:16 PM
    •  
  • Wednesday, July 01, 2009 8:48 PMJCorbitt Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Great.  I'll give that a try.

    Jeremy
  • Wednesday, July 01, 2009 9:16 PMJCorbitt Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Brian,

    I did exactly what you stated:

    1. Open Virtual Network manager and delete all virtual networks.
    2. Double check that each physical NIC is connected to the physical segment it should be.
    3. look in Network connections and verify that you only have two "Network Connections" (document their names, they should have all the Windows default properties - no strange or unusual settings or bindings) that represent your physical NICs
    4. return to Virtual Nework Manager and create an External virtual Network using NIC 2
    5. Note the new Network Adapter created in Network Connections (this is the one you need to disable)
    6. Modify the settings of your VM, selecting this new virtual Network.

    and IT WORKED!

    Many thanks,

    Jeremy

  • Wednesday, July 01, 2009 9:53 PMBrian Borg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    If you ping a VM from the Hyper-V host, do you see any flashing on the external hub or switch, or on the ethernet jacks on the computer?

    If so, additional network traffic is being generated, slowing down your network.

    Maybe an example will help:
    C:\>ipconfig /all
    
    Windows IP Configuration
    . . .
    Ethernet adapter Local Area Connection 3:
    
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Microsoft Virtual Network Switch Adapter #2
       Physical Address. . . . . . . . . : 00-1F-D0-86-04-CB
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
       IPv4 Address. . . . . . . . . . . : 192.168.2.249(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . :
       DNS Servers . . . . . . . . . . . : 192.168.2.252
                                           192.168.2.251
                                           192.168.2.253
                                           192.168.2.1
       Primary WINS Server . . . . . . . : 192.168.2.252
       Secondary WINS Server . . . . . . : 192.168.2.250
       NetBIOS over Tcpip. . . . . . . . : Disabled
    
    Ethernet adapter Local Area Connection:
    
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC (NDIS 6.0)
       Physical Address. . . . . . . . . : 00-0F-B5-FB-46-D9
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
       IPv4 Address. . . . . . . . . . . : 192.168.2.250(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.2.1
       DNS Servers . . . . . . . . . . . : 192.168.2.253
                                           192.168.2.1
                                           192.168.2.252
                                           192.168.2.251
       Primary WINS Server . . . . . . . : 192.168.2.250
       NetBIOS over Tcpip. . . . . . . . : Enabled
    . . .
    C:\>route print
    ===========================================================================
    Interface List
     15 ...00 1f d0 86 04 cb ...... Microsoft Virtual Network Switch Adapter #2
     11 ...00 0f b5 fb 46 d9 ...... Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC (NDIS 6.0)
      1 ........................... Software Loopback Interface 1
     13 ...00 00 00 00 00 00 00 e0  isatap.{858FE9C5-B1D3-4BBB-BFC2-B4F7CA022541}
     12 ...02 00 54 55 4e 01 ...... Teredo Tunneling Pseudo-Interface
     16 ...00 00 00 00 00 00 00 e0  isatap.{14262579-E469-405D-AA87-1ADA81B2AC22}
    ===========================================================================
    
    IPv4 Route Table
    ===========================================================================
    Active Routes:
    Network Destination        Netmask          Gateway       Interface  Metric
              0.0.0.0          0.0.0.0      192.168.2.1    192.168.2.250    266
            127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
            127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
      127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
          192.168.2.0    255.255.255.0         On-link     192.168.2.249    261
          192.168.2.0    255.255.255.0         On-link     192.168.2.250    266
        192.168.2.249  255.255.255.255         On-link     192.168.2.249    261
        192.168.2.250  255.255.255.255         On-link     192.168.2.250    266
        192.168.2.255  255.255.255.255         On-link     192.168.2.249    261
        192.168.2.255  255.255.255.255         On-link     192.168.2.250    266
            224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
            224.0.0.0        240.0.0.0         On-link     192.168.2.249    261
            224.0.0.0        240.0.0.0         On-link     192.168.2.250    266
      255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      255.255.255.255  255.255.255.255         On-link     192.168.2.249    261
      255.255.255.255  255.255.255.255         On-link     192.168.2.250    266
    ===========================================================================
    Persistent Routes:
      Network Address          Netmask  Gateway Address  Metric
              0.0.0.0          0.0.0.0      192.168.2.1  Default
    ===========================================================================
    

    Ipconfig shows that the NIC being used by the virtual switch, and the VM's, does not have a default gateway.  The route command shows the only route to the world (0.0.0.0) is out interface 192.168.2.250 and through router 192.168.2.1.

    The local subnet, 192.168.2.0, has routes through both 192.168.2.250 and 192.168.2.249, since it includes external and virtual machines.

    You can tell a lot from the pretty, flashing lights.  When I ping the Hyper-V host from an external machine, it uses one NIC.  When I ping a virtual machine from the external machine, it uses the other NIC.

    When I ping a virtual machine from the host, it doesn't use either NIC.  It is all virtual and doesn't take up any physical network bandwidth.