-sys-class-net-bonding_masters
The /sys/class/net/bonding_masters
file in Linux provides a list of all the bonding interfaces (also called bond devices) that are currently configured on the system. It contains the names of the bonding interfaces, such as bond0
, bond1
, etc.
This file is particularly useful for administrators or scripts to easily identify the active bonding interfaces on the system.
Example of Usage
Check the current bonding interfaces on your system:
Example Output:
This output indicates that there are two bonding interfaces, bond0
and bond1
, on the system.
Explanation:
The
/sys/class/net/bonding_masters
file contains the names of all the master bonding interfaces configured on the system.Each bonding interface represents a logical link aggregation device that combines multiple physical network interfaces (called slaves) to increase bandwidth or provide redundancy.
How to Create or View Bonding Interfaces:
View details of a bonding interface:
For example, to check the configuration of bond0
, you can look at:
This command will show the bonding mode (e.g., active-backup
, balance-rr
, etc.) for bond0
.
Creating a bonding interface:
If you have not created a bonding interface, you can do so by editing the network configuration files or using the following commands:
In the /etc/network/interfaces
file (Debian/Ubuntu) or /etc/sysconfig/network-scripts/ifcfg-bond0
(RedHat/CentOS), you can configure the bonding interface and add slave interfaces.
Example (Debian/Ubuntu):
Summary
The /sys/class/net/bonding_masters
file is a simple and efficient way to view all the bonded interfaces on your system. If you are managing network interfaces and need to ensure that multiple network interfaces are aggregated into a single virtual interface, this file helps you confirm the active bonding interfaces.
Last updated