Redhat – Grab mac address using udev on RHEL

linux-networkingredhat

Somehow the ifcfg script for eth0 and eth1 on my server has the same HWAddr in it:

# Intel Corporation 82571EB Gigabit Ethernet Controller
DEVICE=eth0
SLAVE=yes
MASTER=bond0
HWADDR=00:1b:21:ac:ae:d2
ONBOOT=no
BOOTPROTO=none
TYPE=Ethernet

# Intel Corporation 82571EB Gigabit Ethernet Controller
DEVICE=eth1
SLAVE=yes
MASTER=bond0
HWADDR=00:1b:21:ac:ae:d2
ONBOOT=no
BOOTPROTO=none
TYPE=Ethernet

How can I use udev to get the correct MAC from the hardware?

Best Answer

After bootup run DMESG to see the the correct MAC addy's then edit eth0 & eth1; ifconfig eth0 hw ether xx:xx:xx:xx:xx