Main Menu

Search

Showing posts with label Network. Show all posts
Showing posts with label Network. Show all posts

LINUX: PING command to do PING test over a specific Network interface (How To Doc)

Following PING command can be used to do ping test over a specific network interface.
ping -I <interface> <destination host/IP>
For example if you want to ping destination IP 10.10.10.10 over eth0 interface of the machine from machine you are doing PING test, your command will look like below.
ping -I eth0 10.10.10.10
Products to which Article Applies
All Linux Operating Systems

Article Author: Tarun Boyella

INFINIBAND: How To Check Status Of Infiniband Links On the Nodes/Hosts Using Infiniband Network? ("iblinkinfo" Command)

Below iblinkinfo command can be used.
iblinkinfo | egrep "HCA|PCIe"

Below is example snippet of above command from Exalogic rack using Infiniband networks. testingcn01-cn08 are Linux nodes and testingsn01 and sn02 are Storage nodes with IB HCA/PCIe cards. Below output shows both the links to all the linux nodes and storage heads are up.

# iblinkinfo | egrep "HCA|PCIe"
CA: testingsn01 PCIe 1:
CA: testingsn02 PCIe 1:
CA: testingcn08 EL-C 192.168.5.108 HCA-1:
          12    5[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      21    2[  ] "testingcn02 EL-C 192.168.5.102 HCA-1" ( )
          12    6[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      19    2[  ] "testingcn01 EL-C 192.168.5.101 HCA-1" ( )
          12    7[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      30    2[  ] "testingcn04 EL-C 192.168.5.104 HCA-1" ( )
          12    8[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      28    2[  ] "testingcn03 EL-C 192.168.5.103 HCA-1" ( )
          12    9[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>       6    2[  ] "testingcn06 EL-C 192.168.5.106 HCA-1" ( )
          12   10[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      13    2[  ] "testingcn05 EL-C 192.168.5.105 HCA-1" ( )
          12   11[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      17    2[  ] "testingcn07 EL-C 192.168.5.107 HCA-1" ( )
          12   18[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      15    2[  ] "testingcn08 EL-C 192.168.5.108 HCA-1" ( )
          12   31[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>       4    2[  ] "testingsn02 PCIe 1" ( )
          12   32[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>       2    2[  ] "testingsn01 PCIe 1" ( )
CA: testingcn07 EL-C 192.168.5.107 HCA-1:
CA: testingcn05 EL-C 192.168.5.105 HCA-1:
CA: testingcn06 EL-C 192.168.5.106 HCA-1:
CA: testingcn03 EL-C 192.168.5.103 HCA-1:
CA: testingcn04 EL-C 192.168.5.104 HCA-1:
CA: testingcn02 EL-C 192.168.5.102 HCA-1:
          27    5[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      20    1[  ] "testingcn02 EL-C 192.168.5.102 HCA-1" ( )
          27    6[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      18    1[  ] "testingcn01 EL-C 192.168.5.101 HCA-1" ( )
          27    7[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      29    1[  ] "testingcn04 EL-C 192.168.5.104 HCA-1" ( )
          27    8[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      22    1[  ] "testingcn03 EL-C 192.168.5.103 HCA-1" ( )
          27    9[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>       5    1[  ] "testingcn06 EL-C 192.168.5.106 HCA-1" ( )
          27   10[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>       7    1[  ] "testingcn05 EL-C 192.168.5.105 HCA-1" ( )
          27   11[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      16    1[  ] "testingcn07 EL-C 192.168.5.107 HCA-1" ( )
          27   18[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>      14    1[  ] "testingcn08 EL-C 192.168.5.108 HCA-1" ( )
          27   31[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>       3    1[  ] "testingsn02 PCIe 1" ( )
          27   32[  ] ==( 4X          10.0 Gbps Active/  LinkUp)==>       1    1[  ] "testingsn01 PCIe 1" ( )
CA: testingcn01 EL-C 192.168.5.101 HCA-1:



Products to which Article Applies

All Hosts using Infiniband Fabric, Oracle Engineered Systems using Infiniband Fabric.

Additional Reference

https://docs.oracle.com/cd/E86824_01/html/E54764/iblinkinfo-1m.html

 

LINUX: How To Remove & Reload Particular Network Bond on Linux Hosts?

Below are steps for removing and reloading particular network bond on Linux hosts

1. Bring down the network bond using below command. Replace bondX with the bond number you want to remove and reloading.

ifdown bondX

2. Run below command to remove the bonding during the runtime. This command just removes the loaded bonds during runtime, it does not complete remove the bonds.
modprobe -r bonding

3. Bring up the network bond again using below command. Replace bondX with the bond number.

ifup bondX

Products to which Article Applies

All Linux Operating Systems

Additional Reference

https://wiki.linuxfoundation.org/networking/bonding

 

ANSIBLE: Ansible Script to Test Pings Between Multiple Hosts on All Network Interfaces (How To Docs)


Download the ansible script available following github repository link to do ping tests between multiple hosts on all network interfaces.

https://github.com/tarbots/ansible-script-to-test-pings-to-multiple-hosts-all-network-interfaces

Ansible script available in above github repository is very simple, easy to deploy and execute. README.txt file has detailed information on how to do the ping tests using the ansible script files. 



Products to which Article Applies

All Operating Systems which Support Ansible.

Additional Reference


https://github.com/tarbots/ansible-script-to-test-pings-to-multiple-hosts-all-network-interfaces


LINUX: "ip addr" or "ip a" Command To List All Network Interfaces & IP Addresses In Linux (How To Doc)

Below "ip addr" or "ip a" commands can be used to list all network interfaces & IP addresses in Linux.
ip addr | grep -i global

ip a | grep -i global

Below is example output of above commands showing network bonds and their IP addresses.

# ip a | grep global
inet 192.168.20.6/24 brd 192.168.20.255 scope global bond1
inet 192.168.21.6/24 brd 192.168.21.255 scope global bond2
inet 192.168.23.6/24 brd 192.168.23.255 scope global bond0

Products to which Article Applies

All Linux Operating Systems

Oracle VM Manager (OVMM): List All Networks Managed by OVM Manager in OVM CLI (How To Doc)

Below are steps for listing all networks managed by OVM Manager in OVM CLI.

1. From the host running OVM Manager, login to OVM Shell CLI prompt using "admin" user by running below command.

ssh admin@localhost -p 10000

When prompted for password, enter OVM "admin" user password. After successful login you will be in OVM shell prompt "OVM>".

2. In OVM CLI prompt, run below "list network" command. All the networks managed by OVM manager will be listed.

list network

Below is sample output.

OVM> list network
Command: list network
Status: Success
Time: 2019-09-29 14:01:05,116 EDT
Data:
  id:xenbr0  name:
  id:c0a81700  name:10.10.10.0
  id:virbr0  name:
OVM>

Products to which Article Applies

Oracle VM Manager Version 3.3.X & Above Versions

Additional Reference

https://docs.oracle.com/cd/E50245_01/E50252/html/vmcli-ref-list.html

LINUX: NETSTAT Command To Check Network Interface Details - MTU, Packets, Packet Drops (How To Doc) (Troubleshooting Doc)

Below netstat command can be used on Linux Host to check the networks details of all network bonds and interfaces.
netstat -i

Below is example snippet of above command.

Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
bond0      1500   0   659921      0   9987      0  1073469      0      0      0 BMmRU
bond1     64000   0 686886791      0   7094      0 618213044      0      3      0 BMmRU
bond2     64000   0   533927      0  21412      0   578298      0      0      0 BMmRU
bond3     64000   0   227411      0 108451      0       17      0      0      0 BMmRU
bond4     64000   0  3251721      0   2005      0  3250931      0      2      0 BMmRU
bond5     64000   0   273246      0 131156      0       17      0      0      0 BMmRU
eth0       1500   0 24442072      0     43      0  1039815      0      0      0 BMRU
eth646_1.325  1500   0     1721      0   1721      0        0      0      0      0 BMsRU
eth1286_2.325  1500   0   294194      0      5      0   404171      0      0      0 BMsRU
ib0.8002  65520   0 358174856      0   2956      0 323494739      0      2      0 BMsRU
ib0.8003  65520   0   273970      0  10001      0   297042      0      0      0 BMsRU
Below netstat command can be used to check network details of particular network bond / interface.
netstat -I=<bond or interface name>

For e.g. if you want to check the network details of bond0 your command will look as follows:

netstat -I=bond0

Below is example snippet of above command.
# netstat -I=bond0
Kernel Interface table
Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
bond0      1500   0   659970      0   9987      0  1073536      0      0      0 BMmRU

Products to which Article Applies

All Linux Operating Systems
 

Additional Reference

https://linux.die.net/man/8/netstat

LINUX: How To Capture TCP/IP Packets Information For Troubleshooting Network Issues between Two Linux Hosts? ("tcpdump" & "ip" command)

For troubleshooting network communication issues between two Linux hosts. We have to check and verify following on how the tcp/ip packets are transmitted.

  • If the source is sending the packets
  • destination is receiving the packet and sending the reply back.
  • If source is receving the reply back
  • If there are any dropped packets at source during communication.
  • If therea are any dropped packets at destination during communication.

For checking above things we have to do ping tests between Linux hosts which have communication issue and capture following data.

  • tcpdumps capture on ICMP ping protocol- which shows how the tcp/ip packets are transmitted.
  • "ip -s -s -s link" command outputs before and after capturing tcpdumps to see if there is any increase in packet loss.

Network Troubleshooting Data Gathering Steps
Below are steps to capture tcpdumps and ip link command outputs for troubleshooting network issues.

1. Identify two Linux hosts (VM's or Physical hosts) - source and destination VM's which have communication issues. Make a Note of the Linux Hostnames.

2. Identify the network bond/interface name for both source and destination Linux Hosts over which they have communication issues. For e.g. bond1 or eth1 etc.

3. Run below command on the source Linux Host which has issues and capture the ip link command output before the tcpdump test.
ip -s -s -s link>>/tmp/iplink_before_`hostname -s`.out

Above command captures the iplink command output inside /tmp/iplink_before_<hostname>.out file.


4. Run below command on the Destination Linux Host which has issues and capture the ip link command output before the tcpdump test.
ip -s -s -s link>>/tmp/iplink_before_`hostname -s`.out

Above command captures the iplink command output inside /tmp/iplink_before_<hostname>.out file.

5. Now open 2 SSH sessions for each source and destination Linux Hosts.

6. Now in one of the SSH sessions for the source Linux Host run below tcpdump command.
tcpdump -n -i bondX icmp -w /tmp/tcpdumps__$(date +%F'-'%T)_`hostname`.pcap

In above command bondX will be the bond interface of source Linux host. This command saves the tcpdumps inside /tmp with filename as tcpdump_<date/timestamps>_<hostname>. Leave the tcpdump command running and do not do Ctrl C

For e.g. if source Linux Host network is bond1, above command looks like below.
tcpdump -n -i bond1 icmp -w /tmp/tcpdumps__$(date +%F'-'%T)_`hostname`.pcap

7.  Now in one of the SSH sessions for the destination Linux Host run below tcpdump command.

tcpdump -n -i bondX icmp -w /tmp/tcpdumps__$(date +%F'-'%T)_`hostname`.pcap

In above command bondX will be the bond interface of destination VM. This command saves the tcpdumps inside /tmp with filename as tcpdump_<date/timestamps>_<hostname>. Leave the tcpdump command running and do not do Ctrl C


For e.g. if destination Linux Host is bond1, above command looks like below.
tcpdump -n -i bond1 icmp -w /tmp/tcpdumps__$(date +%F'-'%T)_`hostname`.pcap

8. Now send 5 pings from another SSH session of source Linux Host to destination Linux Host IP as follows

ping -c 5 <destination Linux Host IP>

9. Now send 5 pings from another SSH session of destination Linux Host to source Linux Host IP as follows
ping -c 5 <source Linux Host IP>

10. Now go back to the SSH sessions for source and destination Linux Host's where tcpdump is running in above steps 6 & 7 and then do CTRL C to stop tcpdumps.

11. Wait for about 2 minutes at this time.

12.Run below command on the source Linux Host which has issues and capture the ip link command output after the tcpdump test.
ip -s -s -s link>>/tmp/iplink_after_`hostname -s`.out

Above command captures the iplink command output inside /tmp/iplink_after_<hostname>.out file.

13. Run below command on the Destination Linux Host which has issues and capture the ip link command output after the tcpdump test.
ip -s -s -s link>>/tmp/iplink_after_`hostname -s`.out

Above command captures the iplink command output inside /tmp/iplink_after_<hostname>.out file.

14. Capture below data from above steps from both source and destination Linux hosts.


/tmp/tcpdump_*
/tmp/iplink_* 

From above data collection steps we should have below data

From source Linux Host

  • tcpdumps which were captured
  • iplink command output before tcpdump capture
  • iplink command output after tcpdump capture
From Destination Linux Host

  • tcpdumps which were captured
  • iplink command output before tcpdump capture
  • iplink command output after tcpdump capture


Analyzing Data Gathered For Network Issues
TCPDUMPS review

tcpdumps can either be reviewed using wireshark on local machine or they can reviewed on the Linux host itself where they were captured using below tcpdump command.
tcpdump -r <tcpdump filename>

Check the tcpdumps from the source Linux host to see if the packets are going out to destination Linux Host and reply is coming back.

For example in this case lets assume source Linux Host IP is 10.10.10.11 and Destination Linux Host IP is 10.10.10.22, when we look at the tcpdumps on source Linux Host (with .11 IP) we should be seeing requests going out to .22 IP and reply coming back from .22 IP as follows
13:11:13.017013 IP 10.10.10.11 > 10.10.10.22: ICMP echo request, id 6384, seq 28126, length 64
13:11:13.017049 IP 10.10.10.22 > 10.10.10.11: ICMP echo reply, id 6384, seq 28126, length 64
13:11:14.016897 IP 10.10.10.11 > 10.10.10.22: ICMP echo request, id 6384, seq 28127, length 64
13:11:14.016918 IP 10.10.10.22 > 10.10.10.11: ICMP echo reply, id 6384, seq 28127, length 64


Same way when we check the tcpdumps on destination Linux host (with .22 IP), we should see requests coming in from source .11 IP and reply sent back to .11 IP. For example below is the snippet.

13:11:57.195307 IP 10.10.10.11 > 10.10.10.22: ICMP echo request, id 28322, seq 1, length 64
13:11:57.195343 IP 10.10.10.22 > 10.10.10.11: ICMP echo reply, id 28322, seq 1, length 64
13:11:58.185332 IP 10.10.10.11 > 10.10.10.22: ICMP echo request, id 28322, seq 2, length 64
13:11:58.185353 IP 10.10.10.22 > 10.10.10.11: ICMP echo reply, id 28322, seq 2, length 64

"ip -s -s -s link" Output Review

For both source and destination Linux hosts when we review "ip -s -s -s link" in a ideal working scenario there should not be increase in dropped packets on the network interface (where troubleshooting is done) before or after the tcpdumps capture, there should NOT be increase in RX or TX packets drop. 

For example below is sample output of "ip -s -s -s link" command. We should not see increase in dropped packet numbers for RX (received) and TX (transmitted).
bond1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT qlen 1000

    link/ether 00:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    28070237   308525   0       0    0       4486
    RX errors: length   crc     frame   fifo    missed
               0        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    179835757  350942   0       0       0       0
    TX errors: aborted  fifo   window heartbeat transns
               0        0       0       0       2    

Above data capture and review will give enough information where the packets are getting dropped when troubleshooting network communication related information.



Products to which Article Applies


All Linux environments

LINUX: How To Check Speed, Auto Negotiation & Link Detection Settings Of Network Bond / Interface In Linux? ("ethtool" command)

Following ethtool command can be used for check speed, Auto negotiation and Link Detection settings for Network bond / interface in Linux
ethtool <bond / interface>

Below is example snippet of above command.

# ethtool bond0
Settings for bond0:
Supported ports: [ ]
Supported link modes:   Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes:  Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 10000Mb/s
Duplex: Full
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes


Products to which Article Applies

All Linux Operating Systems

Additional References

http://landoflinux.com/linux_ethtool_command.html
https://www.thegeekstuff.com/2010/10/ethtool-command



ILOM: How To Check ILOM Network Configuration

Below command can be used for checking the ILOM Network configurations.
show /SP/network

Below is sample output of above command.


Connected. Use ^D to exit.
-> show /SP/network

 /SP/network

    Targets:
        interconnect
        ipv6
        test

    Properties:

        commitpending = (Cannot show property)
        dhcp_clientid = none
        dhcp_server_ip = none
        ipaddress = 10.10.XX.XX
        ipdiscovery = static
        ipgateway = 10.20.XX.XX
        ipnetmask = 255.255.XX.XX
        macaddress = 00:XX.XX.XX.XX
        managementport = /SYS/MB/NET0
        outofbandmacaddress = 00:XX.XX.XX.XX
        pendingipaddress = 10.10.XX.XX
        pendingipdiscovery = static
        pendingipgateway = 10.20.XX.XX
        pendingipnetmask = 255.255.XX.XX
        pendingmanagementport = /SYS/MB/NET0
        pendingvlan_id = (none)
        sidebandmacaddress = 00:XX.XX.XX.XX
        state = enabled
        vlan_id = (none)

    Commands:

        cd
        set
        show

-> Session closed
Disconnected


Products to which Article Applies


All Host Operating Systems Using ILOM


Additional Reference

ILOM: How To Do Ping Test Whether IP Address Is Reachable From ILOM?

Below are steps to do PING test from ILOM to check whether a network IP Address is reachable.

1. Login to Server ILOM as root user.

2. cd to /SP/network/test/ using below command.
cd /SP/network/test/ 
3. Ping the IP address you want to test from ILOM as follows:
set ping=<IP>

If the ping to IP address succeeds we get  ping succeeded message.  If the ping fails we get below failure message.
set: Ping test failed

Products to which Article Applies


All Host Operating Systems Using ILOM

Additional Reference




LINUX: How to Collect TCPDUMPS With Ping Tests Between Linux Hosts For Troubleshooting Network Issues (Troubleshooting & Debugging Doc)

For troubleshooting Network related issues like ping failures, packet losses, routing issues for troubleshooting the issues we will often end up collecting the tcpdumps on Linux systems.

As a basic first step for troubleshooting the communication between source and destination hosts PING test (which goes over ICMP protocol) can be used for testing and tcpdumps can be captured on how the packets are being sent and received.

Below steps provide details on how tcpdumps can be executed on source and target for capturing packets information during PING tests. In below steps we are capturing tcpdumps on just ICMP protocol which just shows ping traffic. This way we are not looking at the other unrelated traffic data on source and target VM's.

1. Identify the  of both source and destination VM's between which there is communication issues. Make a note of interface of both source and target VM's. We will need interface name to pass it as argument for capturing tcpdumps on ICMP protocol (on which pings go)

2. Now open 2 SSH sessions for each source and destination VM's.

3. Now in one of the SSH sessions for the source VM run below tcpdump command.

tcpdump -n -i interfaceX icmp -w /tmp/`hostname`_tcpdumps__$(date +%F'-'%T).pcap

In above command interfaceX will be the interface name of source VM. This command saves the tcpdumps inside /tmp with filename as hostname_tcpdump and date/timestamps. Leave the tcpdump command running and do not do Ctrl C.


For e.g. if source VM if interface name is eth0, above command looks like below.


tcpdump -n -i eth0 icmp -w /tmp/`hostname`_tcpdumps__$(date +%F'-'%T).pcap

4.  Now in one of the SSH sessions for the destination VM run below tcpdump command. 


tcpdump -n -i interfaceX icmp -w /tmp/`hostname`_tcpdumps__$(date +%F'-'%T).pcap

In above command interfaceX will be the interface name of destination VM. This command saves the tcpdumps inside /tmp with filename as hostname_tcpdump and date/timestamps. Leave the tcpdump command running and do not do Ctrl C

For e.g. if destination VM has interface name as eth1, above command looks like below.


tcpdump -n -i eth1 icmp -w /tmp/`hostname`_tcpdumps__$(date +%F'-'%T).pcap

5. Now send 5 pings from another SSH session of source VM to destination VM IP as follows.


ping -c 5 <destination VM IP>

6. Now send 5 pings from another SSH session of destination VM to source VM IP as follows.



ping -c 5 <source VM IP>

7. Now go back to the SSH sessions for source and destination VM's where tcpdump is running in above steps 3 & 4 and then do CTRL C to stop tcpdumps.

8. Now you can read the tcpdumps using below command.
tcpdump -r <tcpdump filename>

In above command replace tcpdump filename with the tcpdump filenames captured in above steps 3 & 4. Below is how the tcpdump file snippet looks which shows traffic over ICMP ping protocol.

16:53:03.814888 IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 35900, seq 1, length 64
16:53:03.814943 IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 35900, seq 1, length 64
16:53:04.804932 IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 35900, seq 2, length 64
16:53:04.804949 IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 35900, seq 2, length 64
16:53:05.804717 IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 35900, seq 3, length 64
16:53:05.804750 IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 35900, seq 3, length 64
16:53:06.804728 IP 192.168.0.1 > 192.168.0.2: ICMP echo request, id 35900, seq 4, length 64
16:53:06.804766 IP 192.168.0.2 > 192.168.0.1: ICMP echo reply, id 35900, seq 4, length 64

Products to which Article Applies


All Linux Operating Systems.


Additional References

http://www.cs.unh.edu/cnrg/people/lin/help/tcpdumpCookbook.htm

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