Linux getting started Tutorial: how to set a static MAC address on a VMware ESXi Virtual Machine

Source: Internet
Author: User
Tags ssh access

Linux getting started Tutorial: how to set a static MAC address on a VMware ESXi Virtual Machine

Q: I want to assign a static MAC address to a virtual machine on VMware ESXi. However, when I started to do this, the virtual machine could not be started, and an error such as "00: 0c: 29: 1f: 4a: AB is not an allowed static Ethernet address. it conflicts with VMware reserved MACs "(00: 0c: 29: 1f: 4a: AB is not a legal static ethernet address. It conflicts with the reserved MAC address of VMWare ). How can I set a static MAC address on a VMware ESXi Virtual Machine?

When you create a virtual machine on VMware ESXi, each network interface of the virtual machine is assigned a dynamic NAC address. If you want to change the default behavior and assign a static MAC address to your Vm

As you can see, VMWare's vSphere GUI client already has a menu for allocating static MAC addresses to virtual machines. However, the GUI-based method only allows you to select a static MAC address in the range of 00: 50: 56: xx, which is the MAC address range reserved by VMWare. If you try to set any MAC address out of this range, you will not be able to start the VM, and then you will see the following error.

So what if I want to set any MAC address for the virtual machine?

Fortunately, there is a temporary solution for this restriction. You do not need to use the vSphere GUI client for editing. After logging on to the ESXi host, edit the. vmx file of your VM.

First, shut down the virtual machine that you want to allocate a static MAC address.

Enable SSH access to your ESXi host, if you haven't done so yet. Then, log on to the ESXi host through SSH.

Move to the directory where the. vmx file of your VM is located.

# Cd vmfs/volumes/datastore1/[name-of-vm]

Open the. vmx file in a text editor and add the following lines. Replace the MAC address with your own MAC address.

Ethernet0.addressType = "static"
Ethernet0.checkMACAddress = "false"
Ethernet0.address = "00: 0c: 29: 1f: 4b: ac"

Now you can start the VM using the static MAC address defined in the. vmx file.

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.