Friday, July 13, 2012

Device eth0 has different MAC address than expected

1.                  Check virtual machine MAC address and change accordingly in Linux box

Or,

2.         Edit /etc/sysconfig/network-script/ifcfg-eth0 in Linux box

3.         Remove all except DEVICE, ONBOOT, BOOTPROTO parametes.

4.         Change BOOTPROTO=dhcp:

            # cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

5.         Restart network service

6.         Check MAC address by “ifconfig” command:

            # ifconfig eth0 | grep HWaddr
eth0      Link encap:Ethernet  HWaddr 00:0C:29:48:DB:9A

7.         Add HWADDR, IPADDR, NETMASK, GATEWAY in “ifcfg-eth0”  file:

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:0C:29:48:DB:9A
IPADDR=192.168.100.231
NETMASK=255.255.254.0
GATEWAY=192.168.100.1

8.         Restart network service

2 comments: