I always used to think that the MAC addresses generated for VM's running in a virtual environment(e.g. VMware) are just some random numbers until I came across this article. And that made me realized that I still have to learn lot of things which leads us to the topic of this blog post.
I'm pretty sure that most of the people who have been working with VMware for some years now will be aware of this. However I'm writing this post for someone who is new to VMware and has just started their journey in IT.
The following schemes of MAC address generation are available in vCenter Server -
VMware OUI allocation, default allocation
Prefix-based allocation
Range-based allocation
1. VMware OUI allocation
VMware OUI allocation is the default MAC address assignment model for virtual machines. The allocation works with up to 64 vCenter Server instances, and each vCenter Server can assign up to 64000 unique MAC addresses.
VMware Organizationally Unique Identifier (OUI) allocation assigns MAC addresses based on the default VMware OUI 00:50:56 and the vCenter Server ID. To find the vCenter ID for your vCenter, navigate to vCenter Server > Configure > Settings > General > Runtime Settings
According to the VMware OUI allocation scheme, a MAC address has the format 00:50:56:XX:YY:ZZ where 00:50:56 represents the VMware OUI, XX is calculated as (80 + vCenter Server ID), and YY and ZZ are random two-digit hexadecimal numbers. The addresses created through the VMware OUI allocation are in the range 00:50:56:80:YY:ZZ - 00:50:56:BF:YY:ZZ
As we can see the first three pairs of a MAC address is granted to a vendor or manufacturer. VMware has four such assignments; 00:50:56, 00:0C:29, 00:05:69 and 00:1C:14.
Let's take an example of MAC address (00:50:56:97:11:33) to understand this better.
Based on the below scheme, we can determine the vCenter Server Unique ID-
Take the 4th octet - for 00:50:56:97:11:33, it would be 97
Subtract 0x80 - 0x97 - 0x80 = 0x17
Rebase it from Base-16 to to Base-10 - In our example, it would be 0x17 → 23
vCenter Server Unique ID = 23
The VMware OUI allocation scheme is suitable for small scale deployments.
2. Prefix-based allocation
Prefix-based allocation can be used to specify an OUI other than the default one 00:50:56 by VMware, or to introduce Locally Administered MAC Addresses (LAA) for a larger address space.
This type of MAC address allocation overcomes the limits of the default VMware allocation to provide unique addresses in larger scale deployments. Introducing an LAA prefix leads to a very large MAC address space (2 to the power of 46) instead of an universally unique address OUI which can give only 16 million MAC addresses. While using this you need to verify that the prefixes that you provide for different vCenter Server instances in the same network are unique. vCenter Server relies on the prefixes to avoid MAC address duplication issues.
3. Range-based allocation
Range-based allocation can be used to include or exclude ranges of Locally Administered Addresses (LAA).
Once you specify one or more ranges using a starting and ending MAC addresses, for example,(02:50:68:00:00:02, 02:50:68:00:00:FF), MAC addresses are generated only from within the specified range. You can specify multiple ranges of LAA, and vCenter Server tracks the number of used addresses for each range. vCenter Server allocates MAC addresses from the first range that still has addresses available. vCenter Server checks for MAC address conflicts within its ranges.
When using range-based allocation, you must provide different instances of vCenter Server with ranges that do not overlap. vCenter Server does not detect ranges that might be in conflict with other vCenter Server instances.
In case of standalone ESXi host (which is not managed by any vCenter server), ESXi generates the MAC address for VM. Such addresses have a separate VMware OUI(00:0C:29). In this case the last three octets in hexadecimal format of the virtual machine UUID. The virtual machine UUID is based on a hash calculated by using the UUID of the ESXi physical machine and the path to the configuration file (.vmx) of the virtual machine.
For more information please refer MAC Address Management document from VMware.
That's it for now.
I hope now you will have an understanding of how the MAC addresses are generated.
Thank you for reading!
*** Explore | Share | Grow ***
Comments