Main Menu

Search

How To Check Active Slave For Particular Network Bond On Linux Machine

In general HA Linux Machines have 2 slaves for each network bond. This is to ensure that network works when one of the network slave links does not work due to upstream issues like issues with the switches. Below is the command for checking the slaves for network bond.
cat /proc/net/bonding/bondX
In above command bondX is the name of the network bond. For e.g. if you have a network bond as bond0, your ifconfig command will show it as follows.

bond0     Link encap:Ethernet  HWaddr 00:ZZ:ZZ:ZZ:ZZ:1b            inet addr:10.ZZ.ZZ.ZZ  Bcast:10.ZZ.ZZ.ZZ  Mask:255.ZZ.ZZ.0
          inet6 addr: ZZZZ::ZZZ:ZZZ:zZZZ:ZZZZ/ZZ Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:ZZZZZZZZZ errors:0 dropped:ZZZZZZ overruns:0 frame:0
          TX packets:ZZZZZZZZZ errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:ZZZZZZZZZZZZ (2ZZ.Z GiB)  TX bytes:ZZZZZZZZZZZZ (2ZZ.Z GiB)

In order to check the active slave for bond0 below is the command to use.

cat /proc/net/bonding/bond0
  
Following is snippet of above command. From below command output we see that bond0 has 2 slaves eth1276_2.3131 & eth641_1.3131 and eth1276_2.3131 slave is the active slave. If notice ifconfig output the Hardware address 00:ZZ:ZZ:ZZ:ZZ:1b shown is the Hardware address corresponding to eth1276_2.3131 slave as it is the active slave.
  Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

  Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
  Primary Slave: None
  Currently Active Slave: eth1276_2.3131
  MII Status: up
  MII Polling Interval (ms): 250
  Up Delay (ms): 5000
  Down Delay (ms): 5000


  Slave Interface: eth1276_2.3131
  MII Status: up
  Speed: 10000 Mbps
  Duplex: full
  Link Failure Count: 0
  Permanent HW addr: 00:ZZ:ZZ:ZZ:ZZ:1b
  Slave queue ID: 0


  Slave Interface: eth641_1.3131
  MII Status: up
  Speed: 10000 Mbps
  Duplex: full
  Link Failure Count: 0
  Permanent HW addr: 00:ZZ:ZZ:ZZ:ZZ:1a
  Slave queue ID: 0

Products to which Article Applies



All Linux Operating Systems

Additional References

https://docs.oracle.com/cd/E37670_01/E41138/html/ch10s05.html




tarun boyella


No comments:

Post a Comment