From 48e5ad611bc63575eb1150024939d04eb62cf400 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 24 Sep 2019 18:53:05 +0200 Subject: Python/ifconfig: T1557: refactor Interface 'proxy_arp_pvlan' property to set_proxy_arp_pvlan() --- python/vyos/ifconfig.py | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'python/vyos/ifconfig.py') 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' -- cgit v1.2.3