-sys-class-net-bond-bonding-miimon
The /sys/class/net/bond*/bonding/miimon
file in Linux contains the MII (Media Independent Interface) monitoring interval in milliseconds for a bonded network interface. This value is used in network interface bonding (also called NIC teaming) to determine how frequently the kernel checks the link status of each network slave interface.
Example of Usage
Check the
miimon
interval for a bonding interface (e.g.,bond0
):
Example Output:
This output indicates that the link status is being checked every 100 milliseconds.
Explanation:
The
miimon
value sets the time interval (in milliseconds) between checks of the link status for each slave in the bond.A value of
0
means that MII monitoring is disabled.The most commonly used values are
100
ms (a check every 0.1 seconds) or1000
ms (a check every 1 second), depending on the desired frequency of the status check.
How it Works:
When MII monitoring is enabled (with a non-zero miimon
value), the bonding driver sends MII status requests to each interface in the bond. If the driver detects a failure in any slave interface (such as a cable being unplugged), it will mark the interface as "down" and stop sending traffic over that interface. If the interface comes back up, it will be marked as "up," and traffic will resume on that interface.
Adjusting the miimon
value:
miimon
value:The miimon
value can be set when configuring the bonding interface, for example:
Alternatively, you can set the miimon
value in your network interface configuration file (e.g., /etc/network/interfaces
or /etc/sysconfig/network-scripts/ifcfg-bond0
), depending on your Linux distribution.
Example configuration (Debian/Ubuntu):
This would set up a bond interface bond0
with MII monitoring at 100 ms intervals.
Summary
The /sys/class/net/bond*/bonding/miimon
file allows you to check the current link monitoring interval for a bonded interface. By adjusting this value, you can control how frequently the bonding driver checks for link failures, balancing between faster detection of issues and CPU/network overhead from too frequent checks.
Last updated