diff options
| author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-11 17:37:45 +0200 | 
|---|---|---|
| committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-11 17:37:45 +0200 | 
| commit | cc9be6701d01bc5a229f339d21746bc9250972b5 (patch) | |
| tree | f305e667c682cb85049a115b10379369b48864f1 /python | |
| parent | 4ca0e563861f1d0ebf99afc012a9b95d9492e399 (diff) | |
| download | vyos-1x-cc9be6701d01bc5a229f339d21746bc9250972b5.tar.gz vyos-1x-cc9be6701d01bc5a229f339d21746bc9250972b5.zip | |
interface: T2449: add ability to set accept_ra
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/ifconfig/interface.py | 21 | 
1 files changed, 20 insertions, 1 deletions
| diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 7b42e3399..61f2c6482 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -134,8 +134,12 @@ class Interface(Control):              'validate': assert_boolean,              'location': '/proc/sys/net/ipv4/conf/{ifname}/arp_ignore',          }, +        'ipv6_accept_ra': { +            'validate': lambda ara: assert_range(ara,0,3), +            'location': '/proc/sys/net/ipv6/conf/{ifname}/accept_ra', +        },          'ipv6_autoconf': { -            'validate': lambda fwd: assert_range(fwd,0,2), +            'validate': lambda aco: assert_range(aco,0,2),              'location': '/proc/sys/net/ipv6/conf/{ifname}/autoconf',          },          'ipv6_forwarding': { @@ -409,6 +413,21 @@ class Interface(Control):          """          return self.set_interface('arp_ignore', arp_ignore) +    def set_ipv6_accept_ra(self, accept_ra): +        """ +        Accept Router Advertisements; autoconfigure using them. + +        It also determines whether or not to transmit Router Solicitations. +        If and only if the functional setting is to accept Router +        Advertisements, Router Solicitations will be transmitted. + +        0 - Do not accept Router Advertisements. +        1 - (default) Accept Router Advertisements if forwarding is disabled. +        2 - Overrule forwarding behaviour. Accept Router Advertisements even if +            forwarding is enabled. +        """ +        return self.set_interface('ipv6_accept_ra', accept_ra) +      def set_ipv6_autoconf(self, autoconf):          """          Autoconfigure addresses using Prefix Information in Router | 
