Skip to content

Commit b2ed3d9

Browse files
committed
T7388: IPv6 neighbor discovery not supported by every interface type
The commit b124f0b ("interface: T4627: support IPv6 Interface Identifier (token) for SLAAC") revealed an incorrect assumption in VyOS: that all interface types in use inherently support SLAAC and IPv6 Neighbor Discovery (ND). However, this assumption does not hold true for WireGuard, Tunnel, and VTI interfaces. Therefore, the corresponding CLI option should not be available for these interface types. Additionally, SLAAC support should be removed for them in a future pull request. To address this, remove the "ipv6 address autoconf" CLI tree from the following interface types using a migration script: * WireGuard * Tunnel * VTI
1 parent cce330c commit b2ed3d9

File tree

6 files changed

+58
-2
lines changed

6 files changed

+58
-2
lines changed

interface-definitions/include/interface/ipv6-options-base.xml.i

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<help>IPv6 address configuration modes</help>
1616
</properties>
1717
<children>
18-
#include <include/interface/ipv6-address-autoconf.xml.i>
1918
#include <include/interface/ipv6-address-eui64.xml.i>
2019
#include <include/interface/ipv6-address-no-default-link-local.xml.i>
2120
</children>

interface-definitions/include/interface/ipv6-options-neighbor-discovery.xml.i

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<children>
44
<node name="address">
55
<children>
6+
#include <include/interface/ipv6-address-autoconf.xml.i>
67
#include <include/interface/ipv6-address-interface-identifier.xml.i>
78
</children>
89
</node>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<!-- include start from include/version/interfaces-version.xml.i -->
2-
<syntaxVersion component='interfaces' version='33'></syntaxVersion>
2+
<syntaxVersion component='interfaces' version='34'></syntaxVersion>
33
<!-- include end -->

smoketest/configs/dialup-router-wireguard-ipv6

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,11 @@ interfaces {
977977
}
978978
wireguard wg100 {
979979
address 172.16.252.128/31
980+
ipv6 {
981+
address {
982+
autoconf
983+
}
984+
}
980985
mtu 1500
981986
peer HR6 {
982987
address 100.65.151.213
@@ -988,6 +993,11 @@ interfaces {
988993
}
989994
wireguard wg200 {
990995
address 172.16.252.130/31
996+
ipv6 {
997+
address {
998+
autoconf
999+
}
1000+
}
9911001
mtu 1500
9921002
peer WH56 {
9931003
address 80.151.69.205

smoketest/configs/tunnel-broker

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ interfaces {
6363
address 172.16.0.5/30
6464
encapsulation gre
6565
dhcp-interface eth0
66+
ipv6 {
67+
address {
68+
autoconf
69+
}
70+
}
6671
remote-ip 192.0.2.101
6772
}
6873
tunnel tun300 {
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Copyright (C) 2025 VyOS maintainers and contributors
4+
#
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License version 2 or later as
7+
# published by the Free Software Foundation.
8+
#
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
#
17+
# T7388: remove "ipv6 address autoconf" from certain CLI nodes whose
18+
# underlaying interface does not support IPv6 neighbor discovery
19+
20+
from vyos.configtree import ConfigTree
21+
22+
base = ['interfaces']
23+
24+
def migrate(config: ConfigTree) -> None:
25+
for iftype in ['tunnel', 'wireguard', 'vti']:
26+
# bail out early if interface type does not exist in config
27+
base_iftype = base + [iftype]
28+
if not config.exists(base_iftype):
29+
continue
30+
for interface in config.list_nodes(base_iftype):
31+
base_interface = base_iftype + [interface]
32+
33+
autoconf_path = base_interface + ['ipv6', 'address', 'autoconf']
34+
if config.exists(autoconf_path):
35+
config.delete(autoconf_path)
36+
# delete empty CLI config under 'address' node
37+
if len(config.list_nodes(autoconf_path[:-1])) == 0:
38+
config.delete(autoconf_path[:-1])
39+
# delete empty CLI config under 'ipv6' node
40+
if len(config.list_nodes(autoconf_path[:-2])) == 0:
41+
config.delete(autoconf_path[:-2])

0 commit comments

Comments
 (0)