summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-13 21:02:24 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-13 21:02:24 +0200
commit87e952c83318cb591e0228a9ab84460f90ccb544 (patch)
tree0e2838695a40d526fc83c660167ad4712e102be4
parent7f491ffb8fd9d3ca8d6d6b6571dec262cc8fec01 (diff)
downloadvyos-1x-87e952c83318cb591e0228a9ab84460f90ccb544.tar.gz
vyos-1x-87e952c83318cb591e0228a9ab84460f90ccb544.zip
Python/ifconfig: T1557: bonding: add miimon property
-rw-r--r--python/vyos/ifconfig.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index 7cb5ebe78..0793fad39 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -1179,6 +1179,45 @@ class BondIf(EthernetIf):
return self._write_sysfs('/sys/class/net/{}/bonding/arp_ip_target'
.format(self._ifname), target)
+ @property
+ def miimon(self):
+ """
+ Specifies the MII link monitoring frequency in milliseconds.
+ This determines how often the link state of each slave is
+ inspected for link failures. A value of zero disables MII
+ link monitoring. A value of 100 is a good starting point.
+
+ The default value is 0.
+
+ Example:
+ >>> from vyos.ifconfig import BondIf
+ >>> BondIf('bond0').miimon
+ '250'
+ """
+ return self._read_sysfs('/sys/class/net/{}/bonding/miimon'
+ .format(self._ifname))
+
+
+ @miimon.setter
+ def miimon(self, time):
+ """
+ Specifies the MII link monitoring frequency in milliseconds.
+ This determines how often the link state of each slave is
+ inspected for link failures. A value of zero disables MII
+ link monitoring. A value of 100 is a good starting point.
+
+ The default value is 0.
+
+ Example:
+ >>> from vyos.ifconfig import BondIf
+ >>> BondIf('bond0').miimon = 250
+ >>> BondIf('bond0').miimon
+ '250'
+ """
+ return self._write_sysfs('/sys/class/net/{}/bonding/miimon'
+ .format(self._ifname), time)
+
+
def add_port(self, interface):
"""
Enslave physical interface to bond.