Assign a fix MAC address to a vmware network interface

Reading Time: < 1 minute

MAC addresses are assigned at the bootup of a virtual machine. But there is a way to assign a fix hardware address to a vmware network interface by editing the virtual machine with Vi.

Simply connect with SSH to your ESXi and go to /vnfs/datastore1 or anywhere you put your vm.

If your virtual machine is called vm1, go to /vmfs/datastore1/vm1

Open the file vm1.vmx using Vi.

Around the end of the file there will be the configuration of the network interfaces.

You should see things like:

Reading Time: < 1 minute

MAC addresses are assigned at the bootup of a virtual machine. But there is a way to assign a fix hardware address to a vmware network interface by editing the virtual machine with Vi.

Simply connect with SSH to your ESXi and go to /vnfs/datastore1 or anywhere you put your vm.

If your virtual machine is called vm1, go to /vmfs/datastore1/vm1

Open the file vm1.vmx using Vi.

Around the end of the file there will be the configuration of the network interfaces.

You should see things like:

ethernet0.virtualDev = “e1000”
ethernet0.networkName = “VM Network”
ethernet0.addressType = “generated”

Add a line at the end of this section:

ethernet0.address = 00:50:56:00:00:80

If you have more than one NIC, replace ethernet0 by the appropriate value.

I chose 00:00:80 for this vm but you can choose anything with that patern:

00:50:56:XX:YY:ZZ

Start or restart your VM and you should see the changes.

By Marc Olivier Meunier

Marc has spent the past few years putting oil on the fire of a hyper growth ad tech company. At Smartly.io he was in charge of scaling the support and its culture. At Eficode he is now leading an engineering team and running operations. He leads by example and puts a lot of emphasis on diversity and inclusion, constantly working to create a safe environment. A warm leader with a passion for memorable experiences and innovation.
Find Marc on Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *