-sys-class-net-bond-bonding-slaves
The /sys/class/net/bond*/bonding/slaves file is part of the Linux sysfs filesystem and is used to display the list of network interfaces (slaves) currently bonded to a particular bonding interface. The wildcard (*) in bond* refers to the name of the bonding interface (e.g., bond0, bond1).
Example of Usage
Check bonded slaves for
bond0:
cat /sys/class/net/bond0/bonding/slavesThis will return a list of network interfaces (e.g., eth0, eth1) that are currently enslaved (bonded) to bond0.
Example Output:
eth0 eth1This shows that eth0 and eth1 are slaves of bond0.
Check bonded slaves for any bonding interface:
If you're unsure of the bonding interface name, you can list the slaves for all bond interfaces by using a wildcard:
cat /sys/class/net/bond*/bonding/slavesThis command will return the bonded slaves for all available bonding interfaces in your system.
Additional Bonding Information
You can also explore more details about each bonding interface by checking other files under /sys/class/net/bond*/bonding/. For example:
Mode of the bonding interface:
cat /sys/class/net/bond0/bonding/modeStatus of each bonded interface (including link state):
cat /sys/class/net/bond0/bonding/ad_actor_oper_port_stateLink status of each slave:
cat /sys/class/net/bond0/bonding/slave_eth0/link_failure_countThis structure under /sys/class/net/ provides detailed bonding information, including the performance and status of each slave in a bonding interface.
Summary
The /sys/class/net/bond*/bonding/slaves file gives a straightforward way to check which network interfaces are currently part of a bond. This is particularly useful in environments where network redundancy and load balancing are configured through network interface bonding.
Last updated