Changing mac address in VMware

In Centos:
1. Edit old mac HWADDR=XX:XX:XX:XX:XX:XX in the file /etc/sysconfig/network-script/ifcfg-eth0.
2. Check the file /etc/udev/rules.d/70-persistent-net.rules. Make sure it has no sections with old mac. If it has, delete them.

# PCI device 0x1022:0x2000 (pcnet32) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:XX:XX:XX:XX:XX", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
 
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="YY:YY:YY:YY:YY:YY", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Delete first section with old mac and change "eth1" to "eth0" in second section.

3. Check links

cd /sys/class/net
ls -l
ip link set dev eth1 name eth0

This will change link from eth1 (old nic) to eth0

4. Restart network

service network restart

Was this answer helpful?

 Print this Article

Also Read

Set hostname

Set host name on Centos: /etc/sysconfig/network   HOSTNAME="mycomputer"...

Squid with authentication on Centos 6

How to install Squid with authentication on Centos 6 >>Get VPS with current...

LXDE + xrdp

How to install Lightweight X11 Desktop Environment (LXDE) on Ubuntu. apt-get update...

Pptpd on Centos 6

How to install pptpd server on Centos 6 NOTE than pptpd is potentially unsecure and the tunnel...

Squid+Privoxy+Tor

How to install squid with tor [NOTE: According to vpsget.com AUP/TOS you can use private proxy...