none
Can a virtual machine on Hyper-V use the same MAC address as a host machine's MAC address? RRS feed

  • Question

  • Hello,
    Can a virtual machine on Hyper-V use the same MAC address as a host machine's MAC address?
    Due to our internal network restrictions, the virtual machine mac address can not be registered in the network white list. I am examining whether this limitation can be solved by using the mac address of the host physical machine in a virtual machine.
    If this works, could you let me know how to setup the Hyper-V network and virtual machine settings?

    Best regards,

    Gokigen

    Monday, June 3, 2019 12:34 PM

All replies

  • What are they connected to? In general a switch keeps a table of which MAC addresses are attached to which ports. So if the two are on same switch then the switch is going to update table each time it receives packets from each making for some intermittent, inconsistent connectivity.

     

     



    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.


    Monday, June 3, 2019 1:41 PM
  • Hi,

    Thanks for your question.

    Hyper-V allows a virtual machine to be created with a static or dynamic MAC address. A static MAC address is one that the Hyper-V administrator assigns to the virtual machine. We can set a static MAC address which can be registered in the white list. However, based on my experience, we can not set two same MAC address for the devices in a same network.  

    Right click on the virtual machine in Hyper-V manager. Click Network Adapter and select Advanced Features from the list. Boxes show the static MAC address of your virtual machine. We can refer to the following figure and article,

    https://www.dtonias.com/set-vm-static-mac-address-hyper-v/

    I suggest a another workaround for your need, we can configure to share the host NIC adapter so that we can connect the VM to the physical network. Please refer to the following article,

    https://cloudtidings.com/2017/10/31/hyper-v-networking-improvements-nat-and-what-does-it-means-to-you/

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    Hope above information can help you. If you have any question or concern, please feel free to let me know.

    Best regards,

    Michael


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

    Tuesday, June 4, 2019 2:55 AM
    Moderator
  • I agree with Dave.  The MAC address is the 'real' address used by networking for moving packets between nodes.  Though it is possible to configure a VM with any MAC address you want, having duplicate MAC addresses on the same network is a recipe for problems.  Virtualization does not change the basics of networking.  You would have the exact same issues if you had two physical machines on the same network.

    tim

    Tuesday, June 4, 2019 12:12 PM
  • Hi,

    If your host has 2 network cards you can change one of it mac address and then 

    disable option:



    then your VM can use mac of host

    Tuesday, June 4, 2019 12:29 PM
  • Hello Michael,

    Thank you for information! I believe the setting will solve my issue. I will try to connect with the same IP address using the same MAC address for host machine and virtual machine. Get back to you soon.

    Best regards,
    Gokigen
    • Edited by Gokigen Tuesday, June 4, 2019 2:04 PM
    Tuesday, June 4, 2019 2:04 PM
  • Just because it is possible does not mean that it will work.  Networking standards say you cannot have the same MAC address for two machines.

    tim

    Wednesday, June 5, 2019 12:29 PM
  • Hello Michael,

    Thank you for information! I believe the setting will solve my issue. I will try to connect with the same IP address using the same MAC address for host machine and virtual machine. Get back to you soon.

    Best regards,
    Gokigen

    That won't work.  Best case, one of them (VM or host) will be kicked off your network, worst case you'll get a call from your network admin.  If you've got a MAC restriction, you've probably got MAC monitoring.  A MAC needs to be unique on the network.   

    You could use NAT or contact your IT/Network admin to get an exception.

    Wednesday, June 5, 2019 4:04 PM
  • Hi,

    How are things going on?

    Essjae and Tim are right.  A MAC needs to be unique on the network.  We can set a static MAC for the VM, however you cannot have the same MAC address for two machines.

    If there's a restriction of MAC on your network, you need to permit it. 

    If you have any question or concern, please feel free to let me know.

    Best regards,

    Michael 


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

    Thursday, June 6, 2019 8:37 AM
    Moderator
  • Hi,

    How are things going on?

    Please feel free to let me know if you need further assistance.

    Best regards,

    Michael


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

    Monday, June 10, 2019 7:30 AM
    Moderator
  • Hi,

    Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.

    Best Regards,

    Michael


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

    Wednesday, June 12, 2019 3:39 AM
    Moderator
  • Hi,

    How are things going on?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Michael


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

    Friday, June 14, 2019 3:58 AM
    Moderator