Building a Bonded Interface in Netplan: MII vs ARP Monitoring
As a Data Protection Consultant, I recently faced an issue while building a bonded interface for a server using Netplan. The configuration was not being utilized properly, and I found that the current documentation lacks important information regarding the use of both MII and ARP monitoring. In this blog post, I will share my experience and provide examples of both methods to help you choose the best one for your needs.
Background Information
———————
When working with network switches of questionable quality, I prefer to use a simpler active-backup network resiliency mechanism instead of configuring active-active methods that can cause compatibility issues between the server OS and the switch. In this case, I was trying to create a simple active-backup bonded interface so that if one NIC fails, another interface should carry on serving traffic.
Monitoring Interface Failure
—————————
There are two ways of monitoring an interface failure in Netplan:
1. MII (Media Independent Interface) Monitoring: This method monitors the physical connection state of your network interface. It is useful for copper interfaces, but it can introduce problems when working with optical connections. If your fibre module is present but the optical connection isn’t within your interface, it can still report as ‘UP’ even though you can’t pass traffic via the interface, which can cause outages.
2. ARP (Address Resolution Protocol) Monitoring: This method uses sending ARP requests to one or more IP addresses (up to 16 at present) and confirming network health via the reachability to other network resources. The benefit of this method is that you can monitor multiple network devices without a common failure, and you can confirm whether the interface is capable of reaching devices.
Conflicts with MII and ARP Monitoring
————————————-
If you try to utilize both MII and ARP monitoring in your Netplan configuration, you may encounter issues. Specifically, Netplan will silently ignore any configuration changes you make, and upon reboot, it will not restore your interface with any configured changes. To avoid this issue, you need to choose either MII or ARP monitoring for your bonded interface.
Examples of Both Methods
————————-
Here are some examples of both methods to help you choose the best one for your needs:
MII Monitoring Example:
“`yaml
network:
version: 2
renderer: networkd
interfaces:
enp0s3:
type: ethernet
mac: 00:11:22:33:44:55
mii-monitor-interval: 10
“`
ARP Monitoring Example:
“`yaml
network:
version: 2
renderer: networkd
interfaces:
enp0s3:
type: ethernet
mac: 00:11:22:33:44:55
arp-targets:
– 192.168.1.1
– 192.168.1.2
“`
Troubleshooting Commands
————————-
To assist with any troubleshooting, you can use the following commands:
* `netplan generate` or `netplan apply` with `–debug` to generate or apply your Netplan configuration with a debug output.
* `ip link show` to confirm the current configuration of your bonded network interface.
* `ip link show up` and `ip link show down` to confirm which interface(s) are currently UP or DOWN.
Conclusion
———-
In conclusion, when building a bonded interface in Netplan, it is essential to choose either MII or ARP monitoring based on your needs. Both methods have their advantages and disadvantages, and Netplan may silently ignore any configuration changes if you use both methods simultaneously. By understanding the differences between these two methods and using the troubleshooting commands provided above, you can ensure that your bonded interface is properly configured and resilient to network failures.