Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions data/templates/dhcp-client/ipv6.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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) %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try if it is possible to drop the entire line 8

Copy link
Contributor Author

@nvandamme nvandamme Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • (address is vyos_defined and 'dhcpv6' in address) might be removed because the user explicitly expects to have an ipv6 address provided by dhcpv6 for common interfaces.

  • the removal of (ipv6 is vyos_defined and ipv6.address is vyos_defined and 'dhcpv6' in ipv6.address) will always provide an IA_NA address to the user when dhcpv6-pd is setup on a pppoe interface: leaving this part ensure the user have the choice to request an ipv6 address for the pppoe interface with or without dhcpv6-pd and vice-versa.

I very much prefer to leave this line (and line 29) as it is proposed on commit e0cefe0, because it is specifically handling these scenarios:

  • requesting explicitly an ipv6 via dhcpv6 on a common interface (not pppoe) via set interface type name address dhcpv6
  • requesting explicitly an ipv6 via dhcpv6 on a pppoe interface independently of any dhcpv6-pd configuration via set interface pppoe pppoeN ipv6 address dhcpv6
  • requesting explicitly dhcpv6-pd on a pppoe interface without requesting a dedicated ipv6 for this pppoe interface.

Note: set interface type name dhcpv6-options temporary is not explicit and might be confusing for pppoe's case, in my opinion.

@c-po what do you think about it?

{% 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 %}
Expand All @@ -26,7 +30,7 @@ interface {{ ifname }} {
script "{{ dhcp6_script_file }}";
};

{% 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.temporary is not vyos_defined %}
id-assoc na 0 {
# Identity association for non temporary address
Expand Down
12 changes: 12 additions & 0 deletions interface-definitions/include/interface/dhcpv6-options.xml.i
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
<valueless/>
</properties>
</leafNode>
<leafNode name="no-request-domain-name">
<properties>
<help>Do not request domain name</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="no-request-dns">
<properties>
<help>Do not request DNS servers</help>
<valueless/>
</properties>
</leafNode>
<tagNode name="pd">
<properties>
<help>DHCPv6 prefix delegation interface statement</help>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- include start from interface/ipv6-address-dhcpv6.xml.i -->
<leafNode name="dhcpv6">
<properties>
<help>Enable acquisition of IPv6 address using DHCPv6</help>
<valueless/>
</properties>
</leafNode>
<!-- include end -->
1 change: 1 addition & 0 deletions interface-definitions/interfaces_pppoe.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<help>IPv6 address configuration modes</help>
</properties>
<children>
#include <include/interface/ipv6-address-dhcpv6.xml.i>
#include <include/interface/ipv6-address-autoconf.xml.i>
#include <include/interface/ipv6-address-interface-identifier.xml.i>
</children>
Expand Down
2 changes: 1 addition & 1 deletion python/vyos/ifconfig/pppoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading