11

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.

DigitalRoss
  • 868
  • 1
  • 6
  • 15
  • I think nobody else actually understood your question correctly, but I thing I do. I'll see if I can find something and report back. – Yanick Girouard Feb 28 '12 at 01:24

8 Answers8

10

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!

Yanick Girouard
  • 2,385
  • 1
  • 18
  • 19
9

On RHEL/CentOS 6:

# ethtool -P <if>

Permanent address: 00:11:22:33:44:55
Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
bchill
  • 101
  • 1
  • 2
8

You can get this from /sys instead of /proc. For example:

$ cat /sys/class/net/eth0/address
0a:58:ac:16:05:13

All the interfaces available are listed under net:

$ ls /sys/class/net/
eth0  lo
slm
  • 7,615
  • 16
  • 56
  • 76
3

The OS should keep a list of physical NIC details within the file:

/etc/udev/rules.d/70-persistent-net.rules

Here is mine as an example:

# This file maintains persistent names for network interfaces.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-persistent-net-generator.rules
# file; however you are also free to add your own entries.

# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:23:54:95:74:e5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Notice the "ATTR{address}==" section?

Soviero
  • 4,366
  • 8
  • 36
  • 60
0

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.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92
xBlender
  • 1
  • 2
-2

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

Bart
  • 203
  • 1
  • 2
  • 2
    A bonded interface intentionally does not behave that way. The OP seems to be looking for the MAC address that was burned into the EEPROM of his physical hardware that is part of such bonded interface. This MAC exits the layer 2 stage when bonding is set up. – rackandboneman May 21 '12 at 19:21
-3

dmesg | grep eth0 && dmesg | grep eth1

You can grab the reported hardware addresses for any interface prior to the bond being established.

vaetis
  • 1
-3

If you are not sure of the interface name (happens with CentOS 7) try: ip addr

and just pick the interface from the list

  • I get the impression you didn't actually read the question. It clearly states: *With bond0 active both MAC addresses are replaced and reported identically by ifconfig.* – kasperd Mar 24 '15 at 21:05