Hyper V Mac Address Manual Staticdwnloadblock



In a Hyper-V host, the MAC addresses received by the VM’s network adapters are dynamic and are defined by the range of the host. I don’t want to repeat myself, I have written an article on this subject.

  1. Hyper-v Set Static Mac Address
  2. Hyper-v Mac Address Dynamic Or Static
  3. Hyper-v Mac Address Change

The final eight bits of the MAC address are set to a hash value based on the name of the virtual machine’s configuration file. For example, if a machine's IP address was 192.34.14.81 (or in hex, 0xc0220e51) and the configuration file was hashed to the value of 95, the MAC address would have the following value: 00:05:69:0e:51:95. This tutorial focuses on how to create a full clone of VM in Hyper-V. Basically, there are 2 ways to clone virtual machine of Hyper-V. The process to clone VM in Hyper-V works in most versions of Hyper-V running in Windows 8, Windows 8.1, Windows 10, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016 or later. In MAC Address Range specify the start and end addresses. In Summary review the settings and click Finish. When the job shows as Completed verify pool in MAC Pools. Release IP addresses. In some circumstances you might want to remove addresses from the MAC pool. For example if a host that was assigned an IP address during bare metal deployment. Specifies the minimum MAC address using a valid hexadecimal value. Use with the MacAddressMaximum parameter to establish a range of MAC addresses that the specified Hyper-V host can assign to virtual machines configured to receive dynamic MAC addresses.

However, there are several cases that we need to have a static MAC address on a VM. For example, when we want to do DHCP Filtering or DHCP Reservations, or if an inventory service or even some application’s license is linked to a MAC address. In such a case, when we move the VM to another Hyper-V host, it must keep the same MAC address. Otherwise, if it had a dynamic address then it would get a new one.

Let’s see how we set a static MAC address to a VM in Hyper-V. As always, this can be done either through Hyper-V Manager or PowerShell.

Set static MAC address using Hyper-V Manager

First, make sure the VM is not running.

Hyper-v Set Static Mac Address

Open Hyper-V Manager and then VM settings. Here, expand the Network Adapter and go to Advanced Features.

To set the VM with a static MAC address, enable the Static option and enter the address you want.

Set static MAC address using PowerShell

This is done using the Set-VMNetworkAdapter cmdlet as you can view below.

Set-VMNetworkAdapter -VMName SRV01 -StaticMacAddress “00112233445566”

Finally, note that when you set up a static MAC address for a VM, be sure it is not within the dynamic address range generated by the Hyper-V host. If it is within the range, then it is possible to give the same address to another VM as the host does not control the management between static and dynamic addresses.

Related posts:

When enabling the Hyper-V role on a Windows 2012 (R2) server, it creates a dynamic MAC address pool of 256 MAC addresses available for VMs. The MAC Address Pool configuration can be found in the Virtual Switch Manager under the Global Network Settings.

The MAC address pool is generated as follows:

  • The first three octets are Microsoft’s IEEE organizationally Unique Identifier, 00:15:5D (which is common on all Hyper-V hosts)
  • The next two octets are derived from the last two octets of the server’s IP address
  • The last octet is automatically generated from the range 0x0 – 0xFF. This gives 256 MAC addresses

As you can see the MAC Address pool creation depends on the IP Address used during the installation of the Hyper-V role. In this example (screenshot above) the IP address was xxx.xxx.250.108 during the Hyper-V role installation. This IP address was assigned by a DHCP server with a short lease time. After enabling the Hyper-V role a static IP address was assigned. This does not change de MAC address pool anymore.

Hyper-v mac address dynamic or static

Hyper-v Mac Address Dynamic Or Static

Hyper-v set static mac address

When installing the Hyper-V role on another server, the server received the same IP address. This results in the same MAC address pool on both servers which means that VMs gets duplicate MAC addresses.

To check the MAC address pool of all the Hyper-V servers, I create a PowerShell listed below. Change the Computername and –Credentials parameters.

Script:

Hyper-v Mac Address Change

Change the MAC address pool use the following command:

Example:

Related posts: