- Hyper-v Set Static Mac Address
- Hyper-v Mac Address Change
- Hyper-v Mac Address Dynamic Or Static
- Hyper-v Static Mac Address
The default MAC address is calculated on the first start: The first three octets (aa-bb-cc) are Microsoft's IEEE organizationally Unique Identifier, 00:15:5D (which is common on all Hyper-V hosts). The next two octets (dd-ee) are derived from the last two octets of the server's IP address. Hyper-V creates a MAC pool based on a mathematical hash of its original IP address. So, if you are initializing a bunch of servers and use the same image/IP to start your work, the chance of having two servers with the same MAC pool is very real - I've had it happen. I manually set the MAC pool on every Hyper-V installation we create.
As IT Pro you must keep documented all IP Addresses of you Servers and any Hardware that connected in the network.
You know every time what ip address used in your network. So you can avoid conflicts and maybe security issues sometimes.
Hyper-v Set Static Mac Address
In small environments it's not so difficult to keep up to date your documentation with all ip addresses.
But in medium and large environments it's difficult.
One of the reason that face very often is that the changes are lot and most of the times forget to keep your documentation up to date.
Today i will explain how can use powershell to show ip addresses of all your Virtual Machines in HYPERV-V Host.
Some of you maybe work in environments with hundreds of Virtual Machines in HYPER-V Host.
Until now to find the ip address of the Virtual Machine you must login and type ipconig in cmd.
Find out how can find all ip addresses with one powersell command
- Login in HYPER-V Host
- Open powershell as administrator
- Most of them we know the get-vm that will bring all the Virtual Machines with specific properties but not the ip addresses.
- Now let's bring all the properties of specific Virtual Machine
get-vm -name Win10 Format-list *
In this post I’m going to talk about the MAC Address Pools in Hyper-V / VMM and the actual way they work.
It seems easy to setup and never look at it again but this can cause some serious issues.
There are many threads on technet forums about virtual machines changing MAC addresses and especially Linux virtual machines losing network connection.
Lets start at the beginning.
In the Hyper-V Manager you can set a specific range what addresses are allocated to the VM’s.
You can see/edit the range under the “Virtual Switch Manager”.
So every new VM gets a MAC address in this range specified on the Hyper-V host.
You can view the MAC of a VM under “Settings > Network Adapter > Advanced Features”
As you can see the allocated MAC is within the specified MAC range.
You could set your own MAC here, using the static MAC option.
But what happens when you have more than 1 host??
Hyper-v Mac Address Change
Hyper-V has an algorithm to deal with duplicate MAC addresses on a single host, but not across multiple hosts.
So, if you not take care it is possible to accidentally deploy hosts with duplicate MAC address pools.
Make sure you do not use the same range on different Hyper-V hosts!!
Once the MAC address pool is created when the Hyper-V role is installed, imaging the host will cause each Hyper-V server deployed using the image to have the same MAC address pool. Even if you sysprep the host before you image it, the registry values are not reset.
MAC Address Regeneration
When Live Migrating VM’s to a different host there’s no problem and the VM will keep the same MAC.
If there’s a different MAC range allocated on the new host the MAC changes when:
– VM is turned on from off state
– VM is restored from save state (Quick migration!)
– Antoher VM uses the same MAC. News about tim thorney....
If you’ve set a static MAC, the MAC moves between hosts.
Hyper-v Mac Address Dynamic Or Static
Unlike Windows, Linux VM’s (Redhat, Centos, Ubuntu etc.) have the MAC address hardcoded in configuration files.
When the above situation occurs the VM will get a new MAC and loses network connectivity.
You will need to edit the network cfg’s and enter the new MAC to get the VM online.
Make sure you use static MAC addresses in this situation!
VMM – Virtual Machine Manager
In VMM a default MAC Address Pool is created with range 00-1D-D8-B7-1C-00 to 00-1D-D8-F4-1F-FF (3998720 addresses).
VM’s deployed with VMM can make use of this default pool when the NIC settings are set right.
Dynamic = Get your MAC from the Hyper-V host
Static = Get your MAC from the VMM MAC address pool
Select static (also in templates and hardware profiles!) to make use of the default MAC Address Pool and overcome any MAC problems.
Once you allocated a MAC from the MAC pool the MAC stays static on all your Hyper-V hosts.
When you select “Static” and leave the value “00:00:00:00:00:00” it will allocate a MAC from the MAC pool for you, you dont have to make up one 😉
When deploying a virtual machine using the Hyper-V Manager on a host managed by SCVMM, the virtual machine will not use the SCVMM static MAC address pool, but will use the locally defined dynamic MAC address pool on the Hyper-V host when selecting “Dynamic”.
When selecting static here, you will need to make up a MAC.