We're setting up some Hyper-V VMs for users who need occasional access to Linux environments, preferring this method over WSL for better manageability and security. We want each VM to use its own IP rather than NAT for easier identification and management, which makes the MAC address essential for IP assignment. I'm curious about the best way to create unique MAC addresses. I was considering starting with the standard Hyper-V OUI prefix 00:15:5D, combining it with the last two octets from the host IP, and incrementing a suffix for each VM (usually ending in :00). Does this approach sound solid? What are your best practices for this?
2 Answers
Hyper-V does a good job of generating a dynamic MAC address for each virtual NIC. If you're looking to move the VM to another cluster, you'll need to set the MAC to static. For your scenario, using static MACs is smart, especially since you're basing DHCP reservations on them.
To assign unique MAC addresses, first ensure your Hyper-V VMs are off before making changes. You can go to the settings of the VM in Hyper-V Manager, head to Network Adapter, and set a static MAC address. Using the 00-15-5D prefix is definitely correct. Remember, if you have multiple Hyper-V hosts, you should modify the VLAN MAC address range to prevent conflicts, since they can default to the same settings.
I appreciate the confirmation on the 00-15-5D prefix! I typically create a new virtual switch to avoid issues with the default settings that are tied to NAT.
Just a heads up: the MAC address range is based on the last two octets of the host's IP address at the installation time of the Hyper-V role. If several hosts have a similar setup, you might run into MAC address collisions.

I'm actually trying to avoid dynamic MACs for exactly that reason, so it's good to hear that static is the way to go. I'm just looking to standardize our process for assigning unique static MACs.