From cda29a956d4c86a33e59555debf5062070412e97 Mon Sep 17 00:00:00 2001 From: Nicolas Vandamme Date: Wed, 3 Sep 2025 10:25:36 +0200 Subject: [PATCH 1/5] pppoe: T7485: no ia-na ipv6 for ppoe link --- data/templates/dhcp-client/ipv6.j2 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/data/templates/dhcp-client/ipv6.j2 b/data/templates/dhcp-client/ipv6.j2 index 311c856c8e..5c2273010b 100644 --- a/data/templates/dhcp-client/ipv6.j2 +++ b/data/templates/dhcp-client/ipv6.j2 @@ -17,6 +17,13 @@ interface {{ ifname }} { {% if dhcpv6_options.rapid_commit is vyos_defined %} send rapid-commit; # wait for immediate reply instead of advertisements {% endif %} +{% elif 'pppoe' in ifname and ipv6.address is vyos_defined and 'autoconf' in ipv6.address %} +{% if dhcpv6_options.temporary is not vyos_defined %} + send ia-na 0; # non-temporary address +{% endif %} +{% if dhcpv6_options.rapid_commit is vyos_defined %} + send rapid-commit; # wait for immediate reply instead of advertisements +{% endif %} {% endif %} {% if dhcpv6_options.pd is vyos_defined %} {% for pd in dhcpv6_options.pd %} @@ -32,6 +39,12 @@ id-assoc na 0 { # Identity association for non temporary address }; {% endif %} +{% elif 'pppoe' in ifname and ipv6.address is vyos_defined and 'autoconf' in ipv6.address %} +{% if dhcpv6_options.temporary is not vyos_defined %} +id-assoc na 0 { + # Identity association for non temporary address +}; +{% endif %} {% endif %} {% if dhcpv6_options.pd is vyos_defined %} From e53e7827eaf8d92b6d7a616fc277a7954c763109 Mon Sep 17 00:00:00 2001 From: Nicolas Vandamme Date: Tue, 16 Sep 2025 16:43:33 +0200 Subject: [PATCH 2/5] pppoe: T7485: no ia-na ipv6 for ppoe link --- data/templates/dhcp-client/ipv6.j2 | 23 +++++++------------ .../include/interface/dhcpv6-options.xml.i | 12 ++++++++++ .../interface/ipv6-address-dhcpv6.xml.i | 8 +++++++ interface-definitions/interfaces_pppoe.xml.in | 1 + 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 interface-definitions/include/interface/ipv6-address-dhcpv6.xml.i diff --git a/data/templates/dhcp-client/ipv6.j2 b/data/templates/dhcp-client/ipv6.j2 index ca60b13fc9..fe3b358c53 100644 --- a/data/templates/dhcp-client/ipv6.j2 +++ b/data/templates/dhcp-client/ipv6.j2 @@ -5,9 +5,13 @@ interface {{ ifname }} { {% if dhcpv6_options.duid is vyos_defined %} send client-id {{ dhcpv6_options.duid }}; {% endif %} -{% if address is vyos_defined and 'dhcpv6' in address %} +{% if (address is vyos_defined and 'dhcpv6' in address) or (ipv6 is vyos_defined and ipv6.address is vyos_defined and 'dhcpv6' in ipv6.address) %} +{% if dhcpv6_options.no_request_dns is not vyos_defined %} request domain-name-servers; +{% endif %} +{% if dhcpv6_options.no_request_domain_name is not vyos_defined %} request domain-name; +{% endif %} {% if dhcpv6_options.parameters_only is vyos_defined %} information-only; {% endif %} @@ -17,13 +21,6 @@ interface {{ ifname }} { {% if dhcpv6_options.rapid_commit is vyos_defined %} send rapid-commit; # wait for immediate reply instead of advertisements {% endif %} -{% elif 'pppoe' in ifname and ipv6.address is vyos_defined and 'autoconf' in ipv6.address %} -{% if dhcpv6_options.temporary is not vyos_defined %} - send ia-na 0; # non-temporary address -{% endif %} -{% if dhcpv6_options.rapid_commit is vyos_defined %} - send rapid-commit; # wait for immediate reply instead of advertisements -{% endif %} {% endif %} {% if dhcpv6_options.pd is vyos_defined %} {% for pd in dhcpv6_options.pd %} @@ -33,13 +30,7 @@ interface {{ ifname }} { script "{{ dhcp6_script_file }}"; }; -{% if address is vyos_defined and 'dhcpv6' in address %} -{% if dhcpv6_options.temporary is not vyos_defined %} -id-assoc na 0 { - # Identity association for non temporary address -}; -{% endif %} -{% elif 'pppoe' in ifname and ipv6.address is vyos_defined and 'autoconf' in ipv6.address %} +{% if (address is vyos_defined and 'dhcpv6' in address) or (ipv6 is vyos_defined and ipv6.address is vyos_defined and 'dhcpv6' in ipv6.address) %} {% if dhcpv6_options.temporary is not vyos_defined %} id-assoc na 0 { # Identity association for non temporary address @@ -52,10 +43,12 @@ id-assoc na 0 { id-assoc pd {{ pd }} { {# length got a default value #} prefix ::/{{ pd_config.length }} infinity; +{% set sla_len = 64 - pd_config.length | int %} {% set count = namespace(value=0) %} {% if pd_config.interface is vyos_defined %} {% for interface, interface_config in pd_config.interface.items() if pd_config.interface is vyos_defined %} prefix-interface {{ interface }} { + sla-len {{ sla_len }}; {% if interface_config.sla_id is vyos_defined %} sla-id {{ interface_config.sla_id }}; {% else %} diff --git a/interface-definitions/include/interface/dhcpv6-options.xml.i b/interface-definitions/include/interface/dhcpv6-options.xml.i index 68d1b172f4..99316d4ed8 100644 --- a/interface-definitions/include/interface/dhcpv6-options.xml.i +++ b/interface-definitions/include/interface/dhcpv6-options.xml.i @@ -11,6 +11,18 @@ + + + Do not request domain name + + + + + + Do not request DNS servers + + + DHCPv6 prefix delegation interface statement diff --git a/interface-definitions/include/interface/ipv6-address-dhcpv6.xml.i b/interface-definitions/include/interface/ipv6-address-dhcpv6.xml.i new file mode 100644 index 0000000000..52d6afefe9 --- /dev/null +++ b/interface-definitions/include/interface/ipv6-address-dhcpv6.xml.i @@ -0,0 +1,8 @@ + + + + Enable acquisition of IPv6 address using DHCPv6 + + + + diff --git a/interface-definitions/interfaces_pppoe.xml.in b/interface-definitions/interfaces_pppoe.xml.in index 66a774e212..0737a06884 100644 --- a/interface-definitions/interfaces_pppoe.xml.in +++ b/interface-definitions/interfaces_pppoe.xml.in @@ -88,6 +88,7 @@ #include + #include #include From 49917cb4837d769ff8601eb4a2312cc5efeed001 Mon Sep 17 00:00:00 2001 From: Nicolas Vandamme Date: Tue, 16 Sep 2025 22:16:18 +0200 Subject: [PATCH 3/5] pppoe: T7485: no ia-na ipv6 for ppoe link --- .../include/interface/ipv6-address-dhcpv6.xml.i | 2 +- interface-definitions/include/interface/ipv6-options.xml.i | 1 + interface-definitions/interfaces_pppoe.xml.in | 2 +- python/vyos/ifconfig/pppoe.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/interface-definitions/include/interface/ipv6-address-dhcpv6.xml.i b/interface-definitions/include/interface/ipv6-address-dhcpv6.xml.i index 52d6afefe9..965bb20aaa 100644 --- a/interface-definitions/include/interface/ipv6-address-dhcpv6.xml.i +++ b/interface-definitions/include/interface/ipv6-address-dhcpv6.xml.i @@ -1,4 +1,4 @@ - + Enable acquisition of IPv6 address using DHCPv6 diff --git a/interface-definitions/include/interface/ipv6-options.xml.i b/interface-definitions/include/interface/ipv6-options.xml.i index f84a9f2cde..54da77c4b7 100644 --- a/interface-definitions/include/interface/ipv6-options.xml.i +++ b/interface-definitions/include/interface/ipv6-options.xml.i @@ -15,6 +15,7 @@ IPv6 address configuration modes + #include #include #include #include diff --git a/interface-definitions/interfaces_pppoe.xml.in b/interface-definitions/interfaces_pppoe.xml.in index 0737a06884..4afe72d8b4 100644 --- a/interface-definitions/interfaces_pppoe.xml.in +++ b/interface-definitions/interfaces_pppoe.xml.in @@ -87,8 +87,8 @@ IPv6 address configuration modes - #include #include + #include #include diff --git a/python/vyos/ifconfig/pppoe.py b/python/vyos/ifconfig/pppoe.py index 4ca66cf4d4..cc766686d4 100644 --- a/python/vyos/ifconfig/pppoe.py +++ b/python/vyos/ifconfig/pppoe.py @@ -116,7 +116,7 @@ def update(self, config): # DHCPv6 PD handling is a bit different on PPPoE interfaces, as we do # not require an 'address dhcpv6' CLI option as with other interfaces - if 'dhcpv6_options' in config and 'pd' in config['dhcpv6_options']: + if ('dhcpv6_options' in config and 'pd' in config['dhcpv6_options']) or ('ipv6' in config and 'address' in config['ipv6'] and 'dhcpv6' in config['ipv6']['address']): self.set_dhcpv6(True) else: self.set_dhcpv6(False) From 47065437b9fd83f91baf96582c4fa7527a017e3e Mon Sep 17 00:00:00 2001 From: Nicolas Vandamme Date: Tue, 16 Sep 2025 22:53:18 +0200 Subject: [PATCH 4/5] pppoe: T7485: no ia-na ipv6 for ppoe link --- interface-definitions/include/interface/ipv6-options.xml.i | 1 - 1 file changed, 1 deletion(-) diff --git a/interface-definitions/include/interface/ipv6-options.xml.i b/interface-definitions/include/interface/ipv6-options.xml.i index 54da77c4b7..f84a9f2cde 100644 --- a/interface-definitions/include/interface/ipv6-options.xml.i +++ b/interface-definitions/include/interface/ipv6-options.xml.i @@ -15,7 +15,6 @@ IPv6 address configuration modes - #include #include #include #include From d50124aba892f3b9df1b9884c0e318b763ea334b Mon Sep 17 00:00:00 2001 From: Nicolas Vandamme Date: Tue, 16 Sep 2025 23:42:19 +0200 Subject: [PATCH 5/5] pppoe: T7485: no ia-na ipv6 for ppoe link --- data/templates/dhcp-client/ipv6.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/data/templates/dhcp-client/ipv6.j2 b/data/templates/dhcp-client/ipv6.j2 index fe3b358c53..00cf4dba21 100644 --- a/data/templates/dhcp-client/ipv6.j2 +++ b/data/templates/dhcp-client/ipv6.j2 @@ -43,12 +43,10 @@ id-assoc na 0 { id-assoc pd {{ pd }} { {# length got a default value #} prefix ::/{{ pd_config.length }} infinity; -{% set sla_len = 64 - pd_config.length | int %} {% set count = namespace(value=0) %} {% if pd_config.interface is vyos_defined %} {% for interface, interface_config in pd_config.interface.items() if pd_config.interface is vyos_defined %} prefix-interface {{ interface }} { - sla-len {{ sla_len }}; {% if interface_config.sla_id is vyos_defined %} sla-id {{ interface_config.sla_id }}; {% else %}