diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-09-15 20:13:07 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-09-15 20:13:07 +0200 |
commit | c4d0b9ed4736911d341efdebf34997e6cee8c5a8 (patch) | |
tree | 69a17499eb72a52b33cf5b92551316b879984694 /python/vyos | |
parent | a9a68a6f1086fd4c978deaf5ddace69c18443756 (diff) | |
parent | 6e169b011569bddd0c07d476528a3ecad56e6499 (diff) | |
download | vyos-1x-c4d0b9ed4736911d341efdebf34997e6cee8c5a8.tar.gz vyos-1x-c4d0b9ed4736911d341efdebf34997e6cee8c5a8.zip |
Merge branch 'current' of github.com:vyos/vyos-1x into equuleus
* 'current' of github.com:vyos/vyos-1x:
bonding: T1614: do not overwrite interface description with interface name
[openvpn] T1661 Adding additional check for tls_dh if it not need for ovpn client
[openvpn] T1662 Defined default remote port if it not set in cli
[openvpn] T1661 Fixing returned value on check function
bonding: T1614: use proper (previously missing) miimon property
Python/ifconfig: T1557: bonding: add miimon property
Python/ifconfig: T1557: bonding: fix class name in comments
bonding: T1660: bugfix for triggered OS permission denied exception
Revert "[bonding] T1660 Adding additional check. Some bonding mode don't support arp_interval"
[bonding] T1660 Adding additional check. Some bonding mode don't support arp_interval
[l2tp] T834 Implementation advanced ppp-options/lcp.
openvpn: T1548: fix missing sys import
[l2tp] T834 fix cli reset commands for l2tp and pptp. Adding l2tp%d tunnel naming.
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/ifconfig.py | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py index 62bf94d79..0793fad39 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' @@ -1179,12 +1179,51 @@ 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. Example: - >>> from vyos.ifconfig import Interface + >>> from vyos.ifconfig import BondIf >>> BondIf('bond0').add_port('eth0') >>> BondIf('bond0').add_port('eth1') """ @@ -1201,7 +1240,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 +1251,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 +1292,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 +1334,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' |