none
Hyper-V Switch with both Ethernet and Wi-Fi

    Question

  • Hi,

    I'm new to Hyper-V and I was wondering If I could get some help configuring Hyper-V Switch.

    I enabled Hyper-V and created two external switches connected to both my Ethernet and Wireless connection:

    Foreach ($net IN Get-NetAdapter -Physical)
    {   
      Write-Output "Creating External Hyper-V Switch for $($net.Name)";
      New-VMSwitch -Name "External Hyper-V Switch for $($net.Name)" -AllowManagementOS $True -NetAdapterName $net.Name
    }

    Depending on what connection I am working with, I then have to change the Network Adapter of my VM (minikube if it makes any difference) accordingly. The question I would like to ask is this:

    Is there a way to ensure that the VM is always assigned the same IP regardless what adapter is using?

    Thank you in advance for any help.

    Alessandro


    Monday, February 20, 2017 12:27 PM

Answers

  • VM networking is exactly the same as physical networking.  If you want a particular VM to always have the same IP address, configure it with a static IP within the operating system of the VM.  If you use DHCP for all IP address assignments, configure a DHCP reservation for the MAC address of the VM.


    . : | : . : | : . tim

    Monday, February 20, 2017 3:41 PM

All replies

  • VM networking is exactly the same as physical networking.  If you want a particular VM to always have the same IP address, configure it with a static IP within the operating system of the VM.  If you use DHCP for all IP address assignments, configure a DHCP reservation for the MAC address of the VM.


    . : | : . : | : . tim

    Monday, February 20, 2017 3:41 PM
  • Hi,

    Are there any updates?

    You could mark the reply as answer if it is helpful. 

    Best Regards,

    Leo


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, March 09, 2017 11:13 AM
    Moderator