Networking in Hyper-V is one of the main feature in a virtual infrastructure.
like physical dimension, for each virtual machine ( for each virtual NIC) assigned a MAC address (classic and logic networking).
The question is:
– How these MAC addresses are created ?
– How these MAC addresses are assigned to Virtual machines ?
– How can i avoid MAC addresses collision ?
– Static Mac addresses or Dynamic MAC addresses ?
John Howard -MSFT has written an excellent blog about how MAC addresses are generated and assigned in Hyper-V.
What can we learn from John:
1- MAC addresses are generated based on the Microsoft IEEE Organizationally Unique Identifier 00-15-5D and the last 16 bytes from the Host IP address: MAC address RANGE = 00-15-5D-(Hex(last 16 bytes of Host IP))+00 to 00-15-5D-(Hex(last 16 bytes of Host IP))+ff
If my host IP address is 192.168.20.1, the last 16 bytes are 20.1, in hex 14-01 and the MAC address range is [00-15-5D-14-01-00;00-15-5D-14-01-ff]
2- How MAC addresses are assigned: Each new created virtual machine NIC receives the next available MAC address.
Example: (NIC1, 00-15-5D-14-01-00), (NIC1, 00-15-5D-14-01-01), (NIC1, 00-15-5D-14-01-02) …
3– If MAC addresses range is saturated: Virtual machine with virtual NIC will be unable to boot
4- Dynamic or Fixed MAC range:
- In production environment, it’s recommended to fix your MAC addresses range. This will simplifie management, tracking, avoid collision.
- If your environment is large, and it’s possible to have two hosts with the same last 16 bytes, think to fix your MAC addresses range
- Try to manage your Virtual environment with SCVMM, it automatically avoid MAC collision, it has global view of all your hosts.