summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 18:53:05 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 21:53:25 +0200
commit48e5ad611bc63575eb1150024939d04eb62cf400 (patch)
tree2102bb376e06206c08b21a1d23610ded52224b16 /python
parent3cedc3358c6aeb9e6caad4251958fa1a05723ea3 (diff)
downloadvyos-1x-48e5ad611bc63575eb1150024939d04eb62cf400.tar.gz
vyos-1x-48e5ad611bc63575eb1150024939d04eb62cf400.zip
Python/ifconfig: T1557: refactor Interface 'proxy_arp_pvlan' property to set_proxy_arp_pvlan()
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig.py36
1 files changed, 2 insertions, 34 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index 86a080602..d32b54199 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -328,8 +328,7 @@ class Interface:
else:
raise ValueError("Value out of range")
- @property
- def proxy_arp_pvlan(self):
+ def set_proxy_arp_pvlan(self, enable):
"""
Private VLAN proxy arp.
Basically allow proxy arp replies back to the same interface
@@ -351,38 +350,7 @@ class Interface:
Example:
>>> from vyos.ifconfig import Interface
- >>> Interface('eth0').proxy_arp_pvlan
- '0'
- """
- return self._read_sysfs('/proc/sys/net/ipv4/conf/{}/proxy_arp_pvlan'
- .format(self._ifname))
-
- @proxy_arp_pvlan.setter
- def proxy_arp_pvlan(self, enable):
- """
- Private VLAN proxy arp.
- Basically allow proxy arp replies back to the same interface
- (from which the ARP request/solicitation was received).
-
- This is done to support (ethernet) switch features, like RFC
- 3069, where the individual ports are NOT allowed to
- communicate with each other, but they are allowed to talk to
- the upstream router. As described in RFC 3069, it is possible
- to allow these hosts to communicate through the upstream
- router by proxy_arp'ing. Don't need to be used together with
- proxy_arp.
-
- This technology is known by different names:
- In RFC 3069 it is called VLAN Aggregation.
- Cisco and Allied Telesyn call it Private VLAN.
- Hewlett-Packard call it Source-Port filtering or port-isolation.
- Ericsson call it MAC-Forced Forwarding (RFC Draft).
-
- Example:
- >>> from vyos.ifconfig import Interface
- >>> Interface('eth0').proxy_arp_pvlan = 1
- >>> Interface('eth0').proxy_arp_pvlan
- '1'
+ >>> Interface('eth0').set_proxy_arp_pvlan(1)
"""
if int(enable) >= 0 and int(enable) <= 1:
return self._write_sysfs('/proc/sys/net/ipv4/conf/{}/proxy_arp_pvlan'