Comment 1 for bug 1745597

Revision history for this message
Ryan Harper (raharper) wrote :

The systemd documentation is somewhat confusing here as well.

MIIMonitorSec=
Specifies the frequency that Media Independent Interface link monitoring will occur. A value of zero disables MII link monitoring. This value is rounded down to the nearest millisecond. The default value is 0.

Netplan currently just passes this value to networkd via the configuration file.

At it turns out, systemd-networkd will allow the values to have suffixes, like 'ms':
So to achieve the 100ms interval you need to put in '100ms' in the value.

root@ubuntu:~# cat /etc/systemd/network/test-bond2-miimon.netdev
[NetDev]
Name=bond2
Kind=bond

[Bond]
Mode=active-backup
MIIMonitorSec=100ms
root@ubuntu:~# cat /sys/class/net/bond2/bonding/miimon
100

This means netplan will need an update to address this. If we attempt to read a netplan yaml using the suffix, then it fails to parse.

# netplan generate
Error in network definition //etc/netplan/50-cloud-init.yaml line 19 column 34: invalid unsigned int value 100ms

An easy path is to update the documentation to accept the value in milliseconds (like NetworkManager) and then when rendering networkd.netdev files, to append the 'ms' suffix.