From 7f491ffb8fd9d3ca8d6d6b6571dec262cc8fec01 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 13 Sep 2019 20:54:12 +0200 Subject: Python/ifconfig: T1557: bonding: fix class name in comments --- python/vyos/ifconfig.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'python/vyos') diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py index 62bf94d79..7cb5ebe78 100644 --- a/python/vyos/ifconfig.py +++ b/python/vyos/ifconfig.py @@ -1086,7 +1086,7 @@ class BondIf(EthernetIf): The default value is layer2 Example: - >>> from vyos.ifconfig import Interface + >>> from vyos.ifconfig import BondIf >>> BondIf('bond0').xmit_hash_policy = 'layer2+3' >>> BondIf('bond0').proxy_arp '1' @@ -1130,7 +1130,7 @@ class BondIf(EthernetIf): The default value is no IP addresses. Example: - >>> from vyos.ifconfig import Interface + >>> from vyos.ifconfig import BondIf >>> BondIf('bond0').arp_interval = '100' >>> BondIf('bond0').arp_interval '100' @@ -1171,7 +1171,7 @@ class BondIf(EthernetIf): The default value is no IP addresses. Example: - >>> from vyos.ifconfig import Interface + >>> from vyos.ifconfig import BondIf >>> BondIf('bond0').arp_ip_target = '192.0.2.1' >>> BondIf('bond0').arp_ip_target '192.0.2.1' @@ -1184,7 +1184,7 @@ class BondIf(EthernetIf): Enslave physical interface to bond. Example: - >>> from vyos.ifconfig import Interface + >>> from vyos.ifconfig import BondIf >>> BondIf('bond0').add_port('eth0') >>> BondIf('bond0').add_port('eth1') """ @@ -1201,7 +1201,7 @@ class BondIf(EthernetIf): Remove physical port from bond Example: - >>> from vyos.ifconfig import Interface + >>> from vyos.ifconfig import BondIf >>> BondIf('bond0').del_port('eth1') """ return self._write_sysfs('/sys/class/net/{}/bonding/slaves' @@ -1212,7 +1212,7 @@ class BondIf(EthernetIf): Return a list with all configured slave interfaces on this bond. Example: - >>> from vyos.ifconfig import Interface + >>> from vyos.ifconfig import BondIf >>> BondIf('bond0').get_slaves() ['eth1', 'eth2'] """ @@ -1253,7 +1253,7 @@ class BondIf(EthernetIf): balance-alb mode. Example: - >>> from vyos.ifconfig import Interface + >>> from vyos.ifconfig import BondIf >>> BondIf('bond0').primary = 'eth2' >>> BondIf('bond0').primary 'eth2' @@ -1295,7 +1295,7 @@ class BondIf(EthernetIf): slaves Example: - >>> from vyos.ifconfig import Interface + >>> from vyos.ifconfig import BondIf >>> BondIf('bond0').mode = '802.3ad' >>> BondIf('bond0').mode '802.3ad' -- cgit v1.2.3 From 87e952c83318cb591e0228a9ab84460f90ccb544 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 13 Sep 2019 21:02:24 +0200 Subject: Python/ifconfig: T1557: bonding: add miimon property --- python/vyos/ifconfig.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'python/vyos') 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. -- cgit v1.2.3