Is there a way to get the original MAC addresses for eth0 and eth1?
A large array of servers have bonding interfaces managing backup switch connections and one is misbehaving. With bond0 active both MAC addresses are replaced and reported identically by ifconfig.
I want to search the server array for a MAC address I found in a Cisco device.
I would use dmesg(1) or /var/log/messages, but they have been rolled over for hundreds of days for most of the array.
I'm still searching for a more "official" explanation, but according to this blog, the file
/proc/net/bonding/${bonding name}
will provide the actual mac address for each NIC in the bond (eth0, eth1, etc..), so that might be more useful.Hope this will help!
On RHEL/CentOS 6:
You can get this from
/sys
instead of/proc
. For example:All the interfaces available are listed under
net
:The OS should keep a list of physical NIC details within the file:
Here is mine as an example:
Notice the "ATTR{address}==" section?
There's a few ways both for SATA and NET devices. Commands like udevadm info will do it as well. ifconfig and netstat as well. And the list goes on. Check some of the old links for above for the full set.
You can use arp to find a MAC address
To find the manufactors MAC the IEEE Registration Authority keeps a list of brand names that belong and there MAC addresses, the first six in a MAC address are the brand name followed by type and serialnumber
Search the Public OUI/'company_id' Listing
dmesg | grep eth0 && dmesg | grep eth1
You can grab the reported hardware addresses for any interface prior to the bond being established.
If you are not sure of the interface name (happens with CentOS 7) try:
ip addr
and just pick the interface from the list