summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-01 19:48:47 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-01 19:48:47 +0200
commit308886a3fc28aa7772c14452185fb06531ba9dfd (patch)
treebf7c7fbbd05b37d2a1e8aa5a40701d01c5e4136b /python
parent534595f4da5dd0d1eefdf0b59d89143482fb1add (diff)
downloadvyos-1x-308886a3fc28aa7772c14452185fb06531ba9dfd.tar.gz
vyos-1x-308886a3fc28aa7772c14452185fb06531ba9dfd.zip
Python/ifconfig: T1557: bonding: add arp_ip_target
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index 86b812161..506004fa0 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -1040,3 +1040,45 @@ class BondIf(Interface):
"""
return self._write_sysfs('/sys/class/net/{}/bonding/arp_interval'
.format(self._ifname), time)
+
+ @property
+ def arp_ip_target(self):
+ """
+ Specifies the IP addresses to use as ARP monitoring peers when
+ arp_interval is > 0. These are the targets of the ARP request sent to
+ determine the health of the link to the targets. Specify these values
+ in ddd.ddd.ddd.ddd format. Multiple IP addresses must be separated by
+ a comma. At least one IP address must be given for ARP monitoring to
+ function. The maximum number of targets that can be specified is 16.
+
+ The default value is no IP addresses.
+
+ Example:
+ >>> from vyos.ifconfig import BondIf
+ >>> BondIf('bond0').arp_ip_target
+ '192.0.2.1'
+ """
+ return self._read_sysfs('/sys/class/net/{}/bonding/arp_ip_target'
+ .format(self._ifname))
+
+ @arp_ip_target.setter
+ def arp_ip_target(self, target):
+ """
+ Specifies the IP addresses to use as ARP monitoring peers when
+ arp_interval is > 0. These are the targets of the ARP request sent to
+ determine the health of the link to the targets. Specify these values
+ in ddd.ddd.ddd.ddd format. Multiple IP addresses must be separated by
+ a comma. At least one IP address must be given for ARP monitoring to
+ function. The maximum number of targets that can be specified is 16.
+
+ The default value is no IP addresses.
+
+ Example:
+ >>> from vyos.ifconfig import Interface
+ >>> BondIf('bond0').arp_ip_target = '192.0.2.1'
+ >>> BondIf('bond0').arp_ip_target
+ '192.0.2.1'
+ """
+ return self._write_sysfs('/sys/class/net/{}/bonding/arp_ip_target'
+ .format(self._ifname), mode)
+