Why does /proc/net/bond0/bonding show that the network interface card's link is up when the cable is unplugged within a bonding environment?

Solution Verified - Updated

Environment

Red Hat Enterprise Linux 5

Issue

When a network interface card cable is unplugged, the link should become "down" in /proc/net/bond0/bonding. Sometimes, unfortunately, the link still shows up even though the cable is unplugged.

Resolution

The bonding parameter use_carrier can be used to solve this problem. This parameter is used to specify the method of determining the link status: MII/ETHTOOL ioctls or netif_carrier_ok(). The default method is to use netif_carrier_ok(). If bonding insists that the link is up when it should not be, it may be that your network device driver does not support netif_carrier_on/off. In this case, setting use_carrier to 0 will cause bonding to revert to using the MII/ETHTOOL ioctl method to determine the link state.

For example:

     # cat /etc/modprobe.conf 
     alias bond0 bonding 
     options bonding mode=1 miimon=100

Add the use_carrier parameter to the options line:

     # cat /etc/modprobe.conf 
     alias bond0 bonding 
     options bonding mode=1 miimon=100 use_carrier=0
Comments

For further information, refer to /usr/share/doc/kernel-doc-*/Documentation/networking/bonding.txt.

Tags

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.