Why does ifconfig for bonded devices show different MAC address than the physical devices?
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Bonding
Issue
- Why do we not have same mac address for interface
eth8in the output ofifconfigand/proc/net/bonding/bond0?
[root@example ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 60:eb:69:82:2a:c8
Slave Interface: eth8
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:19:99:96:cd:69
[root@example ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 60:EB:69:82:2A:C8
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:618065993 errors:0 dropped:0 overruns:1 frame:0
TX packets:569953145 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:88552706929 (82.4 GiB) TX bytes:517841087824 (482.2 GiB)
Memory:92120000-92140000
[root@example ~]# ifconfig eth8
eth8 Link encap:Ethernet HWaddr 60:EB:69:82:2A:C8
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:592106164 errors:0 dropped:0 overruns:1 frame:0
TX packets:569423011 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:86620296239 (80.6 GiB) TX bytes:517075103956 (481.5 GiB)
Memory:91a80000-91b00000
- How to check MAC address of network interfaces when configured with bonding?
Resolution
-
If we use interfaces
eth0andeth8in the bonding configuration ofbond0, thenbond0is called the master (MASTER) whileeth0andeth8are called slaves (SLAVE). -
In bonding configuration the MASTER and SLAVE interfaces will both assume the MAC address of one of the slave interfaces if the MAC address is not explicitly configured (with
ifconfigor theip linkcommand). By default the MAC address of a bonding device is taken from its first slave device (e.g.eth0), and other slave interfaces assume the same MAC address. -
The reason for using a single MAC address for a bonding interface as well as the slave interfaces is to avoid packet drops during fail over between slaves.
-
It is expected behavior to see duplicate MAC address in case bonding is configured. In the following example
ifconfigoutput, all slaves ofbond0have the same MAC address (HWaddr) as slave interfaceeth0(60:EB:69:82:2A:C8).
[root@example ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 60:EB:69:82:2A:C8 <===
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:618065993 errors:0 dropped:0 overruns:1 frame:0
TX packets:569953145 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:88552706929 (82.4 GiB) TX bytes:517841087824 (482.2 GiB)
Memory:92120000-92140000
[root@example ~]# ifconfig eth8
eth8 Link encap:Ethernet HWaddr 60:EB:69:82:2A:C8 <===
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:592106164 errors:0 dropped:0 overruns:1 frame:0
TX packets:569423011 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:86620296239 (80.6 GiB) TX bytes:517075103956 (481.5 GiB)
Memory:91a80000-91b00000
- The actual hardware MAC addresses can be found in /proc/net/bonding/bond0.
[root@example ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 60:eb:69:82:2a:c8 <=== Permanent MAC address of interface eth0
Slave Interface: eth8
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:19:99:96:cd:69 <=== Permanent MAC address of interface eth8
- For detailed information refer to the kernel documentation:
# less /usr/share/doc/kernel-doc-*/Documentation/networking/bonding.txt
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.