Jump to Navigation

271 - Status Check for network NIC bonding

Bonding is nothing but Linux kernel feature that allows to aggregate multiple like interfaces (such as eth0, eth1) into a single virtual link such as bond0.
The idea is pretty simple get higher data rates and as well as link failover. Sometimes you need to monitor the status on its health.

1. Check MAC Address & General information

dmesg is a system administration command. Display the system control message from the kernel ring buffer.
This buffer stores all messages since the last system boot, or the most recent ones if the buffer
has been filled.

# dmesg | grep -i eth0

eth0: Broadcom NetXtreme II BCM5709 1000Base-SX (C0) PCI Express found at mem da000000,
IRQ 122, node addr 0024e8596b87
bonding: bond0: Adding slave eth0.
bnx2 0000:01:00.0: eth0: using MSIX
bonding: bond0: enslaving eth0 as a backup interface with a down link.
bnx2 0000:01:00.0: eth0: NIC Remote Copper Link is Up, 1000 Mbps full duplex, receive
& transmit flow control ON
bonding: bond0: link status definitely up for interface eth0.
bonding: bond0: making interface eth0 the new active one.

2. Bonding status

# cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
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: 00:24:e8:59:6b:87

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:24:e8:59:6b:89

3. Check each NIC configuration

* ethtool
ethtool is the standard Linux utility for controlling network drivers and hardware,
particularly for wired Ethernet devices. ethX is the name of the ethernet device to work on.

# ethtool eth0

Settings for eth0:
        Supported ports: [ TP FIBRE ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 2
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Link detected: yes

* Full/Half Duplex
Hal Duplex can not do both rx (recieving) and tx (transmitting).

4. rx/tx issue

Gathering statistics can also be useful for troubleshooting rx/tx issues with your network card.

# ethtool -S eth0

NIC statistics:
     rx_bytes: 844544827
     rx_error_bytes: 0
     tx_bytes: 11000409
     tx_error_bytes: 0
     rx_ucast_packets: 91321
     rx_mcast_packets: 66067
     rx_bcast_packets: 4427363
     tx_ucast_packets: 79701
     tx_mcast_packets: 57
     tx_bcast_packets: 1260
     tx_mac_errors: 0
     tx_carrier_errors: 0
     rx_crc_errors: 0
     rx_align_errors: 0
     tx_single_collisions: 0
     tx_multi_collisions: 0

5. Show Network Interface Status

The netstat command symbolically displays the contents of various network-related data structures.
There are a number of output formats, depending on the options for the information presented.

# netstat -i

bond0   1500   0  9014059      0      0      0  80979      0      0  0BMmRU
eth0    1500   0  4584469      0      0      0  80979      0      0  0BMsRU
eth1    1500   0  4429590      0      0      0      0      0      0  0BMsRU
lo     16436   0     3526      0      0      0   3526      0      0  0LRU
virbr0  1500   0        0      0      0      0     23      0      0  0BMRU

Show the state of interfaces which have been auto-configured
(interfaces statically configured into a system but not located at boot-time are not shown).

6. Bonding Mode, Switch

Sometime Mode:0(Load barancing) is not working on the switches which are configured
as a redundancy. Since One MAC Address is shared with multiple NICs and it errors out on the switches.
Mode:1 can solve the problem, though no load balancing mode. If you want a load balancing, please check and
see with a network provider.

# vi /etc/modprob.conf

alias bond0 bonding
options bonding mode=1 miimon=100


Main menu 2

Story | by Dr. Radut