diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-05-25 21:11:43 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-05-26 17:09:33 +0200 |
commit | 7dddfa338800303335673df637a05d8aaaccdaa2 (patch) | |
tree | fc79b7308429223ea2b47be32c213c36d0b729ba /src | |
parent | d5b58517f88358c686e6c8ea039a7a9a64d6c6ee (diff) | |
download | vyos-1x-7dddfa338800303335673df637a05d8aaaccdaa2.tar.gz vyos-1x-7dddfa338800303335673df637a05d8aaaccdaa2.zip |
dhcpv6-pd: T2506: add option to request specific prefix length
Some ISPs (e.g. Comcast) only delegate a /64 by default. You have to explicitly
"ask" for a bigger (e.g. /60) prefix. This commit adds a CLI node to request
a specific prefix length in the range 32 - 64.
dhcpv6-options {
prefix-delegation {
length 60
}
}
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/interfaces-bonding.py | 3 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-bridge.py | 3 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-ethernet.py | 3 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-pppoe.py | 6 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-pseudo-ethernet.py | 3 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-wireless.py | 3 |
6 files changed, 21 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-bonding.py b/src/conf_mode/interfaces-bonding.py index b531e97fc..ed9b754c3 100755 --- a/src/conf_mode/interfaces-bonding.py +++ b/src/conf_mode/interfaces-bonding.py @@ -299,6 +299,9 @@ def apply(bond): if bond['dhcpv6_temporary']: b.dhcp.v6.options['dhcpv6_temporary'] = True + if bond['dhcpv6_pd_length']: + b.dhcp.v6.options['dhcpv6_pd_length'] = bond['dhcpv6_pd_length'] + if bond['dhcpv6_pd_interfaces']: b.dhcp.v6.options['dhcpv6_pd_interfaces'] = bond['dhcpv6_pd_interfaces'] diff --git a/src/conf_mode/interfaces-bridge.py b/src/conf_mode/interfaces-bridge.py index 865d8a999..adfa81c74 100755 --- a/src/conf_mode/interfaces-bridge.py +++ b/src/conf_mode/interfaces-bridge.py @@ -321,6 +321,9 @@ def apply(bridge): if bridge['dhcpv6_temporary']: br.dhcp.v6.options['dhcpv6_temporary'] = True + if bridge['dhcpv6_pd_length']: + br.dhcp.v6.options['dhcpv6_pd_length'] = br['dhcpv6_pd_length'] + if bridge['dhcpv6_pd_interfaces']: br.dhcp.v6.options['dhcpv6_pd_interfaces'] = br['dhcpv6_pd_interfaces'] diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py index 8ffefc7cf..e9cab4be7 100755 --- a/src/conf_mode/interfaces-ethernet.py +++ b/src/conf_mode/interfaces-ethernet.py @@ -201,6 +201,9 @@ def apply(eth): if eth['dhcpv6_temporary']: e.dhcp.v6.options['dhcpv6_temporary'] = True + if eth['dhcpv6_pd_length']: + e.dhcp.v6.options['dhcpv6_pd_length'] = eth['dhcpv6_pd_length'] + if eth['dhcpv6_pd_interfaces']: e.dhcp.v6.options['dhcpv6_pd_interfaces'] = eth['dhcpv6_pd_interfaces'] diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py index e8aeb810f..eaa61cdb6 100755 --- a/src/conf_mode/interfaces-pppoe.py +++ b/src/conf_mode/interfaces-pppoe.py @@ -36,6 +36,7 @@ default_config_data = { 'deleted': False, 'description': '\0', 'disable': False, + 'dhcpv6_pd_length': '', 'dhcpv6_pd_interfaces': [], 'intf': '', 'idle_timeout': '', @@ -142,6 +143,11 @@ def get_config(): 'dhcpv6-options', 'prefix-delegation'] conf.set_level(dhcpv6_pd_path) + # retriebe DHCPv6-PD prefix helper length as some ISPs only hand out a + # /64 by default (https://phabricator.vyos.net/T2506) + if conf.exists(['length']): + pppoe['dhcpv6_pd_length'] = conf.return_value(['length']) + for interface in conf.list_nodes(['interface']): conf.set_level(dhcpv6_pd_path + ['interface', interface]) pd = { diff --git a/src/conf_mode/interfaces-pseudo-ethernet.py b/src/conf_mode/interfaces-pseudo-ethernet.py index c1f52d42c..c09df15e8 100755 --- a/src/conf_mode/interfaces-pseudo-ethernet.py +++ b/src/conf_mode/interfaces-pseudo-ethernet.py @@ -171,6 +171,9 @@ def apply(peth): if peth['dhcpv6_temporary']: p.dhcp.v6.options['dhcpv6_temporary'] = True + if peth['dhcpv6_pd_length']: + p.dhcp.v6.options['dhcpv6_pd_length'] = peth['dhcpv6_pd_length'] + if peth['dhcpv6_pd_interfaces']: p.dhcp.v6.options['dhcpv6_pd_interfaces'] = peth['dhcpv6_pd_interfaces'] diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py index 54420acd1..8a2736a66 100755 --- a/src/conf_mode/interfaces-wireless.py +++ b/src/conf_mode/interfaces-wireless.py @@ -591,6 +591,9 @@ def apply(wifi): if wifi['dhcpv6_temporary']: w.dhcp.v6.options['dhcpv6_temporary'] = True + if wifi['dhcpv6_pd_length']: + w.dhcp.v6.options['dhcpv6_pd_length'] = wifi['dhcpv6_pd_length'] + if wifi['dhcpv6_pd_interfaces']: w.dhcp.v6.options['dhcpv6_pd_interfaces'] = wifi['dhcpv6_pd_interfaces'] |