Loading

×Sorry to interrupt
Uncaught ReferenceError: addCTracking is not defined
throws at https://kb.vmware.com/resource/KM_TealiumTrackingJS?v=0.5:100:1

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

My Subscriptions

Loading

Knowledge Base

Setting a static MAC address for a virtual NIC (219)

Last Updated: 7/28/2021Categories: How toTotal Views: 54541Language:
Chinese (Simplified)JapaneseEnglish

10 like this article

Subscribe to get an email
newsletter with new updates

10 people found this helpful Please provide article feedback:

Details

I am having a MAC address conflict on one of my virtual machines, or I need to set the MAC address for one of my virtual network adapters manually. Why and how would I do this?

Note: This process detailed in this article applies to ESX 2.5 and earlier. For information on MAC address generation in later versions, see:

ESX/ESXi 3.x: The Setting Up MAC Addresses section of the ESX Server 3 Configuration Guide.

ESX/ESXi 4.x: The MAC Addresses section of the ESXi 4.x Server Configuration guide.

ESXi 5.x - ESXi 7.0: The Setting a Static MAC Address to a Virtual Machine section of the vSphere Networking Documentation.

Solution

Note: This information applies only to ESX 2.5 and earlier, it is not applicable to ESX 3.0 and later. For information about MAC address management in later releases see the relevant documentation for the version of ESXi/ESX you are using.

ESX/ESXi 3.x: The Setting Up MAC Addresses section of the ESX Server 3 Configuration Guide.

ESX/ESXi 4.x: The MAC Addresses section of the ESXi 4.x Server Configuration guide.

ESXi 5.x - ESXi 7.0: The Setting a Static MAC Address to a Virtual Machine section of the vSphere Networking Documentation.

MAC address management in VMware ESX 2.5 and earlier

VMware ESX Server automatically generates MAC addresses for the virtual network adapters in each virtual machine. In most cases, these MAC addresses are appropriate. However, there may be times when you need to set a virtual network adapter's MAC address manually. For example:

You have more than 256 virtual network adapters on a single physical server.

Virtual network adapters on different physical servers share the same subnet and are assigned the same MAC address, causing a conflict.

You want to ensure that a virtual network adapter always has the same MAC address.

This document explains how VMware ESX Server generates MAC addresses and how you can set the MAC address for a virtual network adapter manually.

How VMware ESX Server Generates MAC Addresses

Each virtual network adapter in a virtual machine gets its own unique MAC address. ESX Server attempts to ensure that the network adapters for each virtual machine that are on the same subnet have unique MAC addresses. The algorithm used by ESX Server puts a limit on how many virtual machines can be running and suspended at once on a given machine. It also does not handle all cases when virtual machines on distinct physical machines share a subnet.

A MAC address is a six-byte number. Each network adapter manufacturer gets a unique three-byte prefix called an OUI - organizationally unique identifier - that it can use to generate unique MAC addresses. VMware has two OUIs, one for automatically generated MAC addresses, and one for manually set addresses.

The VMware OUI for automatically generated MAC addresses is 00:0C:29. Thus the first three bytes of the MAC address that is automatically generated for each virtual network adapter have this value. ESX Server then uses a MAC address generation algorithm to produce the other three bytes. The algorithm guarantees unique MAC addresses within a machine and attempts to provide unique MAC addresses between ESX Server machines.

The algorithm that ESX Server uses is the following:

When the algorithm generates the last 24 bits of the MAC address, the first 16 bits are set to the same values as the last 16 bits of the console operating system's primary IP address.

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.

ESX Server keeps track of all MAC addresses that have been assigned to network adapters of running and suspended virtual machines on a given physical machine. ESX Server ensures that the virtual network adapters of all of these virtual machines have unique MAC addresses.

The MAC address of a powered-off virtual machine is not remembered. Thus it is possible that when a virtual machine is powered on again it can get a different MAC address.

For example, if a machine had IP address 192.34.14.81 (or in hex, 0xc0220e51) and the configuration file hashed to the value 95, the MAC address would have the following value:

00:0C:29:0e:51:95

Since there are only eight bits that can vary for each MAC address on an ESX Server machine, this puts a limit of 256 unique MAC addresses per ESX Server machine. This in turn limits the total number of virtual network adapters in all powered-on and suspended virtual machines to 256. This limitation can be eliminated by using the method described in the next section entitled "Setting MAC Addresses Manually".

Note: The use of parts of the console operating system's IP address as part of the MAC address is an attempt to generate MAC addresses that are unique across different ESX Server machines. However, there is no guarantee that different ESX machines with physical network adapters that share a subnet always generate mutually exclusive MAC addresses.

Setting MAC Addresses Manually

To work around both the limit of 256 virtual network adapters per physical machine and possible MAC address conflicts between virtual machines, the MAC addresses can be assigned manually by system administrators. VMware uses a different OUI for manually generated addresses: 00:50:56. To set the addresses open the virtual machine configuration file (.vmx) in a text editor.

Note: The default location is /vmfs/volumes/<datastore_name>/<vm_name>/<vm_name>.vmx.

Add these two lines to the virtual machine's configuration file:

ethernet0.addressType = "static"
ethernet0.address = 00:50:56:XX:YY:ZZ

Where XX is a valid hex number between 00 and 3F and YY and ZZ are valid hex numbers between 00 and FF. The value for XX must not be greater than 3F in order to avoid conflict with MAC addresses that are generated by the VMware Workstation and VMware GSX Server products. Thus the maximum value for a manually generated MAC address is:

ethernet0.address = 00:50:56:3F:FF:FF

VMware ESX Server virtual machines do not support arbitrary MAC addresses, hence the above format must be used. As long as you choose a hex value that is unique among your hard-coded addresses, conflicts between the automatically assigned MAC addresses and the manually assigned ones should never occur.

Additional Information

For translated versions of this article, see:

Español:

Português:

日本語: 仮想 NIC の静的 MAC アドレスを設定する （219） (2078784)

简体中文: 为虚拟网卡设置静态 MAC 地址 (2061912)

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)JapaneseEnglish

Attachments

Additional Resources

KB
•
VLAN タグ付けのためのネットワーク スイッチの構成 (1266)

KB
•
通过 vSphere Management Assistant (vMA) 或 vSphere CLI (vCLI) 重命名虚拟机磁盘 (VMDK) (1002491)

KB
•
vSphere Management Assistant (vMA) または vSphere CLI (vCLI) での仮想マシン ディスクの名前変更 (1002491)

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

Results 1-4 of 4

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vSphere ESXi

VMware ESXi

VMware ESX Server

Related Versions:

VMware vSphere ESXi 7.0.x

VMware vSphere ESXi 7.0.0

VMware vSphere ESXi 6.0

VMware vSphere ESXi 5.5

VMware vSphere ESXi 5.1

VMware vSphere ESXi 5.0

VMware ESXi 4.1.x Installable

VMware ESXi 4.1.x Embedded

VMware ESXi 4.0.x Installable

VMware ESXi 4.0.x Embedded

VMware ESXi 3.5.x Installable

VMware ESXi 3.5.x Embedded

VMware ESX Server 3.5.x

VMware ESX Server 2.5.x

VMware ESX Server 2.1.x

VMware ESX Server 2.0.x

VMware ESX Server 1.x

VMware ESX Server 1.5.x

VMware ESX 4.1.x

VMware ESX 4.0.x

view all

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant