none
Host and VM addressing on /30 network RRS feed

  • Question

  • I am trying to get my head around how host and VM addressing can work when using a /30 network.

    The interface on the router is /30 (say 10.1.1.1/30).  The VM needs to communicate with the router, and I don’t think NAT is an option, so seemingly the interface on the VM must be 10.1.1.2/30.  This leaves no spare addresses on the subnet.

    This being the case, how do I address the physical interface on the HyperV host and configure the virtual switch(es) to allow transparent communication between the VM and the router?

    Friday, February 14, 2020 10:37 PM

Answers

  • Yes, it will just work, but mind you you'll need a vSwitch for VM and another vSwitch for host. Configure the vEthernet on host with the 192.168.21.1 address.

     

     (please don't forget to mark my answers)

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    • Marked as answer by GLONeill Saturday, February 15, 2020 2:43 AM
    Saturday, February 15, 2020 2:41 AM

All replies

  • Seems you should have 2 useable addresses. May need a dedicated vSwitch for this network.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Friday, February 14, 2020 10:50 PM
  • Thanks Dave, although I’ll really not sure how that works.  If I give the host machine an IP address on another network, say 192.168.21.1, and create a vswitch connected to that adapter, and then attach the VM (which will have an IP address of 10.1.1.2/30) to that vswitch, is the vswitch going to transparently allow communication between 10.1.1.1 and 10.1.1.2 via the 192.168.21.1 interface?

    Saturday, February 15, 2020 12:10 AM
  • No, the vSwich is simply a multi port dumb switch. If you need that traffic from 192.168.21.1 10.1.1.2 to then you'll need a router.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Saturday, February 15, 2020 12:21 AM
  • But the router would need to have an interface on the same subnet as the VM, which we know is not possible because there are no spare addresses.  So is it actually going to be impossible to achieve what I need to achieve?

    Saturday, February 15, 2020 12:29 AM
  • Plug both the vSwitchs into a layer three switch with the route configured. You'll have one address to spare.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.


    Saturday, February 15, 2020 12:33 AM
  • Thanks Mark but now I am even more confused.  Surely a layer 3 switch cannot route traffic between two networks unless it is configured with interface addresses on each of those networks.  If that is the case, what addresses would be set on them?

    And does setting up two vswitches mean there needs to be two physical interfaces configured on the host?  If so, what addresses would be configured on those?  Given that the gateway router is already 10.1.1.1/30, the only available address on that subnet to place anywhere is 10.1.1.2/30. 

    Perhaps if you could do a rough diagram of the setup you are proposing it might help me understand where you are going.

    Attached is a diagram of my predicament.  What I ultimately need to achieve is getting the VM to send its gateway traffic to the router - without having to NAT


    Saturday, February 15, 2020 1:22 AM
  • Not sure who Mark is. Yes two physical interfaces for two vSwitches. One for each network 192.168.21.1 10.1.1.2

    vSwitches do not have addresses. When you create a new external vSwitch the internet protocols are removed from the adapter and the Hyper-V Extensible Switch protocol is added turning that physical port into a multi-port virtual switch.

    The diagram you posted shows only a single VM. If that's the case a single vSwitch will do the job, just hook the VM to the vSwitch, plug vSwitch into physical router. Uncheck allow management network to share this adapter

     

    (please don't forget to mark helpful replies as answer)

     

      



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.



    Saturday, February 15, 2020 1:30 AM
  • So does the physical host get given the IP address of 10.1.1.2/30?  And if so, what IP address gets assigned to the VM?  Or does it not actually get its own individual address?

    Saturday, February 15, 2020 1:44 AM
  • The host network does not have anything to do with this. The host can use either another physical adapter or a separate vSwitch.

    You can configure the vEthernet on the VM in the exact same manner as if it were a pyhsical NIC, either static or DHCP assigned address.

     

    (please don't forget to mark helpful replies as answer)

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.



    Saturday, February 15, 2020 1:52 AM
  • Ok, so does that mean that the IP address on the VM is 10.1.1.2/30?  That takes me back to the question of what IP address gets placed on the physical adapter on the host server?  And given that it clearly cannot be on the same subnet as the router that is it physically connected to - how is it going the manage to allow the VM and the router to communicate?

    Saturday, February 15, 2020 2:00 AM
  • Ok, so does that mean that the IP address on the VM is 10.1.1.2/30?

    If that's what you want then you can configure the vEthernet on the VM in the exact same manner as if it were a pyhsical NIC

    That takes me back to the question of what IP address gets placed on the physical adapter on the host server?

    Using another physical NIC you can use any address you like for the network you plan to plug it into.

    And given that it clearly cannot be on the same subnet as the router that is it physically connected to - how is it going the manage to allow the VM and the router to communicate?

    The host would not take part in this communication. https://docs.microsoft.com/en-us/archive/blogs/jhoward/hyper-v-what-are-the-uses-for-different-types-of-virtual-networks 

    Dedicated example

     

     (please don't forget to mark helpful replies as answer)

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.


    Saturday, February 15, 2020 2:07 AM
  • So in other words does that mean it is impossible to get the 10.1.1.2/30 VM to communicate with the 10.1.1.1/30 router.  And the only way to resolve it would be to change to a /29 or lower subnet.

    Saturday, February 15, 2020 2:20 AM
  • Not at all, create the dedicated vSwitch plugged into router, connect the VM to it, assign the VM's vEthernet 10.1.1.2 and finished.

     

     (please don't forget to mark helpful replies as answer)

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.


    Saturday, February 15, 2020 2:24 AM
  • So the router can be 10.1.1.1/30, the VM can be 10.1.1.2/30, and the physical adapter on the host server (which the vswitch will be connected to) can be 192.168.21.1/24.  And it will just work?

    Saturday, February 15, 2020 2:34 AM
  • Yes, it will just work, but mind you you'll need a vSwitch for VM and another vSwitch for host. Configure the vEthernet on host with the 192.168.21.1 address.

     

     (please don't forget to mark my answers)

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    • Marked as answer by GLONeill Saturday, February 15, 2020 2:43 AM
    Saturday, February 15, 2020 2:41 AM
  • Great!  We finally go there.  Thanks for you patience :)

    Saturday, February 15, 2020 2:45 AM
  • Sounds good, you're welcome.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Saturday, February 15, 2020 2:47 AM