diff options
| author | Kyrylo Yatsenko <hedrok@gmail.com> | 2025-12-28 17:21:11 +0200 |
|---|---|---|
| committer | Kyrylo Yatsenko <hedrok@gmail.com> | 2026-01-12 23:17:50 +0200 |
| commit | 2471f686979fd83bd015f124b6faa66f27b8c9ba (patch) | |
| tree | 8cad7c97dc73393e387d99aaf677b588d189758d | |
| parent | e8080f2412a0eeeeea40f12c164213468bca1957 (diff) | |
| download | vyos-1x-2471f686979fd83bd015f124b6faa66f27b8c9ba.tar.gz vyos-1x-2471f686979fd83bd015f124b6faa66f27b8c9ba.zip | |
T7664: ip protocol 'kernel' etc removed
In FRR 10.5 ip protocols
* connected
* kernel
* local
* table
* table-direct
are removed. First three in fb8e399e4f66d09780f176fbecb99168089e64eb,
table* in 7fd030504be060387694e8a2af7f19ddd7dee39d.
In `ip protocols`, `ipv6 protocols` and `vrf` VyOS supports
* connected
* kernel
* table
Remove these from CLI, add migration scripts, update tests.
| -rw-r--r-- | interface-definitions/include/system-ip-protocol.xml.i | 14 | ||||
| -rw-r--r-- | interface-definitions/include/system-ipv6-protocol.xml.i | 12 | ||||
| -rw-r--r-- | interface-definitions/include/version/system-version.xml.i | 2 | ||||
| -rw-r--r-- | interface-definitions/include/version/vrf-version.xml.i | 2 | ||||
| -rw-r--r-- | smoketest/configs/assert/basic-system-ip-protocol | 30 | ||||
| -rw-r--r-- | smoketest/configs/basic-system-ip-protocol | 302 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_system_ip.py | 3 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_system_ipv6.py | 3 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_vrf.py | 4 | ||||
| -rw-r--r-- | src/migration-scripts/system/30-to-31 | 42 | ||||
| -rw-r--r-- | src/migration-scripts/vrf/3-to-4 | 50 |
11 files changed, 435 insertions, 29 deletions
diff --git a/interface-definitions/include/system-ip-protocol.xml.i b/interface-definitions/include/system-ip-protocol.xml.i index c630eb3f7..30d7ab04e 100644 --- a/interface-definitions/include/system-ip-protocol.xml.i +++ b/interface-definitions/include/system-ip-protocol.xml.i @@ -3,7 +3,7 @@ <properties> <help>Filter routing info exchanged between routing protocol and zebra</help> <completionHelp> - <list>any babel bgp connected eigrp isis kernel ospf rip static table</list> + <list>any babel bgp eigrp isis ospf rip static</list> </completionHelp> <valueHelp> <format>any</format> @@ -18,10 +18,6 @@ <description>Border Gateway Protocol</description> </valueHelp> <valueHelp> - <format>connected</format> - <description>Connected routes (directly attached subnet or host)</description> - </valueHelp> - <valueHelp> <format>eigrp</format> <description>Enhanced Interior Gateway Routing Protocol</description> </valueHelp> @@ -30,10 +26,6 @@ <description>Intermediate System to Intermediate System</description> </valueHelp> <valueHelp> - <format>kernel</format> - <description>Kernel routes (not installed via the zebra RIB)</description> - </valueHelp> - <valueHelp> <format>ospf</format> <description>Open Shortest Path First (OSPFv2)</description> </valueHelp> @@ -46,11 +38,11 @@ <description>Statically configured routes</description> </valueHelp> <constraint> - <regex>(any|babel|bgp|connected|eigrp|isis|kernel|ospf|rip|static|table)</regex> + <regex>(any|babel|bgp|eigrp|isis|ospf|rip|static)</regex> </constraint> </properties> <children> #include <include/route-map.xml.i> </children> </tagNode> -<!-- include end -->
\ No newline at end of file +<!-- include end --> diff --git a/interface-definitions/include/system-ipv6-protocol.xml.i b/interface-definitions/include/system-ipv6-protocol.xml.i index 485776a71..1a8123cb2 100644 --- a/interface-definitions/include/system-ipv6-protocol.xml.i +++ b/interface-definitions/include/system-ipv6-protocol.xml.i @@ -3,7 +3,7 @@ <properties> <help>Filter routing info exchanged between routing protocol and zebra</help> <completionHelp> - <list>any babel bgp connected isis kernel ospfv3 ripng static table</list> + <list>any babel bgp isis ospfv3 ripng static</list> </completionHelp> <valueHelp> <format>any</format> @@ -18,18 +18,10 @@ <description>Border Gateway Protocol</description> </valueHelp> <valueHelp> - <format>connected</format> - <description>Connected routes (directly attached subnet or host)</description> - </valueHelp> - <valueHelp> <format>isis</format> <description>Intermediate System to Intermediate System</description> </valueHelp> <valueHelp> - <format>kernel</format> - <description>Kernel routes (not installed via the zebra RIB)</description> - </valueHelp> - <valueHelp> <format>ospfv3</format> <description>Open Shortest Path First (OSPFv3)</description> </valueHelp> @@ -42,7 +34,7 @@ <description>Statically configured routes</description> </valueHelp> <constraint> - <regex>(any|babel|bgp|connected|isis|kernel|ospfv3|ripng|static|table)</regex> + <regex>(any|babel|bgp|isis|ospfv3|ripng|static)</regex> </constraint> </properties> <children> diff --git a/interface-definitions/include/version/system-version.xml.i b/interface-definitions/include/version/system-version.xml.i index a9987e8e4..55764fc40 100644 --- a/interface-definitions/include/version/system-version.xml.i +++ b/interface-definitions/include/version/system-version.xml.i @@ -1,3 +1,3 @@ <!-- include start from include/version/system-version.xml.i --> -<syntaxVersion component='system' version='30'></syntaxVersion> +<syntaxVersion component='system' version='31'></syntaxVersion> <!-- include end --> diff --git a/interface-definitions/include/version/vrf-version.xml.i b/interface-definitions/include/version/vrf-version.xml.i index 9d7ff35fe..1c7c81155 100644 --- a/interface-definitions/include/version/vrf-version.xml.i +++ b/interface-definitions/include/version/vrf-version.xml.i @@ -1,3 +1,3 @@ <!-- include start from include/version/vrf-version.xml.i --> -<syntaxVersion component='vrf' version='3'></syntaxVersion> +<syntaxVersion component='vrf' version='4'></syntaxVersion> <!-- include end --> diff --git a/smoketest/configs/assert/basic-system-ip-protocol b/smoketest/configs/assert/basic-system-ip-protocol new file mode 100644 index 000000000..870ffa8f5 --- /dev/null +++ b/smoketest/configs/assert/basic-system-ip-protocol @@ -0,0 +1,30 @@ +set system ip protocol any route-map 'stub' +set system ip protocol babel route-map 'stub' +set system ip protocol bgp route-map 'stub' +set system ip protocol eigrp route-map 'stub' +set system ip protocol isis route-map 'stub' +set system ip protocol ospf route-map 'stub' +set system ip protocol rip route-map 'stub' +set system ip protocol static route-map 'stub' +set system ipv6 protocol any route-map 'stub' +set system ipv6 protocol babel route-map 'stub' +set system ipv6 protocol bgp route-map 'stub' +set system ipv6 protocol isis route-map 'stub' +set system ipv6 protocol ospfv3 route-map 'stub' +set system ipv6 protocol ripng route-map 'stub' +set system ipv6 protocol static route-map 'stub' +set vrf name red ip protocol any route-map 'stub' +set vrf name red ip protocol babel route-map 'stub' +set vrf name red ip protocol bgp route-map 'stub' +set vrf name red ip protocol eigrp route-map 'stub' +set vrf name red ip protocol isis route-map 'stub' +set vrf name red ip protocol ospf route-map 'stub' +set vrf name red ip protocol rip route-map 'stub' +set vrf name red ip protocol static route-map 'stub' +set vrf name red ipv6 protocol any route-map 'stub' +set vrf name red ipv6 protocol babel route-map 'stub' +set vrf name red ipv6 protocol bgp route-map 'stub' +set vrf name red ipv6 protocol isis route-map 'stub' +set vrf name red ipv6 protocol ospfv3 route-map 'stub' +set vrf name red ipv6 protocol ripng route-map 'stub' +set vrf name red ipv6 protocol static route-map 'stub' diff --git a/smoketest/configs/basic-system-ip-protocol b/smoketest/configs/basic-system-ip-protocol new file mode 100644 index 000000000..84c2c8da7 --- /dev/null +++ b/smoketest/configs/basic-system-ip-protocol @@ -0,0 +1,302 @@ +interfaces { + ethernet eth0 { + address "192.168.0.1/24" + address "fe88::1/56" + duplex "auto" + offload { + gro + gso + sg + tso + } + speed "auto" + } + loopback lo { + } +} +policy { + route-map stub { + } +} +protocols { + static { + arp { + interface eth0 { + address 192.168.0.20 { + mac "00:50:00:00:00:20" + } + address 192.168.0.30 { + mac "00:50:00:00:00:30" + } + address 192.168.0.40 { + mac "00:50:00:00:00:40" + } + } + interface eth2.100 { + address 100.100.0.2 { + mac "00:50:00:00:02:02" + } + address 100.100.0.3 { + mac "00:50:00:00:02:03" + } + address 100.100.0.4 { + mac "00:50:00:00:02:04" + } + } + interface eth2.200 { + address 100.64.200.1 { + mac "00:50:00:00:00:01" + } + address 100.64.200.2 { + mac "00:50:00:00:00:02" + } + } + interface eth2.200.201 { + address 100.64.201.10 { + mac "00:50:00:00:00:10" + } + address 100.64.201.20 { + mac "00:50:00:00:00:20" + } + } + interface eth2.200.202 { + address 100.64.202.30 { + mac "00:50:00:00:00:30" + } + address 100.64.202.40 { + mac "00:50:00:00:00:40" + } + } + } + route 0.0.0.0/0 { + next-hop 100.64.0.1 { + } + } + } +} +system { + config-management { + commit-revisions "100" + } + conntrack { + ignore { + ipv4 { + rule 1 { + destination { + address "192.0.2.2" + } + source { + address "192.0.2.1" + } + } + } + } + modules { + ftp + h323 + nfs + pptp + sip + sqlnet + tftp + } + } + console { + device ttyS0 { + speed "115200" + } + } + host-name "vyos" + ip { + protocol any { + route-map "stub" + } + protocol babel { + route-map "stub" + } + protocol bgp { + route-map "stub" + } + protocol connected { + route-map "stub" + } + protocol eigrp { + route-map "stub" + } + protocol isis { + route-map "stub" + } + protocol kernel { + route-map "stub" + } + protocol ospf { + route-map "stub" + } + protocol rip { + route-map "stub" + } + protocol static { + route-map "stub" + } + protocol table { + route-map "stub" + } + } + ipv6 { + protocol any { + route-map "stub" + } + protocol babel { + route-map "stub" + } + protocol bgp { + route-map "stub" + } + protocol connected { + route-map "stub" + } + protocol isis { + route-map "stub" + } + protocol kernel { + route-map "stub" + } + protocol ospfv3 { + route-map "stub" + } + protocol ripng { + route-map "stub" + } + protocol static { + route-map "stub" + } + protocol table { + route-map "stub" + } + } + login { + user vyos { + authentication { + encrypted-password "$6$O5gJRlDYQpj$MtrCV9lxMnZPMbcxlU7.FI793MImNHznxGoMFgm3Q6QP3vfKJyOSRCt3Ka/GzFQyW1yZS4NS616NLHaIPPFHc0" + plaintext-password "" + } + } + } + name-server "192.168.0.1" + syslog { + console { + facility all { + level "emerg" + } + facility mail { + level "info" + } + } + global { + facility all { + level "info" + } + facility auth { + level "info" + } + facility local7 { + level "debug" + } + marker { + interval "1000" + } + preserve-fqdn + } + host syslog.vyos.net { + facility auth { + level "warning" + } + facility local7 { + level "notice" + } + format { + octet-counted + } + port "8000" + protocol "tcp" + } + } + time-zone "Europe/Berlin" +} +vrf { + name red { + ip { + protocol any { + route-map "stub" + } + protocol babel { + route-map "stub" + } + protocol bgp { + route-map "stub" + } + protocol connected { + route-map "stub" + } + protocol eigrp { + route-map "stub" + } + protocol isis { + route-map "stub" + } + protocol kernel { + route-map "stub" + } + protocol ospf { + route-map "stub" + } + protocol rip { + route-map "stub" + } + protocol static { + route-map "stub" + } + protocol table { + route-map "stub" + } + } + ipv6 { + protocol any { + route-map "stub" + } + protocol babel { + route-map "stub" + } + protocol bgp { + route-map "stub" + } + protocol connected { + route-map "stub" + } + protocol isis { + route-map "stub" + } + protocol kernel { + route-map "stub" + } + protocol ospfv3 { + route-map "stub" + } + protocol ripng { + route-map "stub" + } + protocol static { + route-map "stub" + } + protocol table { + route-map "stub" + } + } + table "1234" + } +} + + +// Warning: Do not remove the following line. +// vyos-config-version: "bgp@6:broadcast-relay@1:cluster@2:config-management@1:conntrack@6:conntrack-sync@2:container@2:dhcp-relay@2:dhcp-server@8:dhcpv6-server@1:dns-dynamic@4:dns-forwarding@4:firewall@15:flow-accounting@1:https@6:ids@1:interfaces@32:ipoe-server@3:ipsec@13:isis@3:l2tp@9:lldp@2:mdns@1:monitoring@1:nat@8:nat66@3:ntp@3:openconnect@3:ospf@2:pim@1:policy@8:pppoe-server@10:pptp@5:qos@2:quagga@11:reverse-proxy@1:rip@1:rpki@2:salt@1:snmp@3:ssh@2:sstp@6:system@27:vrf@3:vrrp@4:vyos-accel-ppp@2:wanloadbalance@3:webproxy@2" +// Release version: 1.4.3 diff --git a/smoketest/scripts/cli/test_system_ip.py b/smoketest/scripts/cli/test_system_ip.py index 3784d4630..25dbeef1d 100755 --- a/smoketest/scripts/cli/test_system_ip.py +++ b/smoketest/scripts/cli/test_system_ip.py @@ -83,8 +83,7 @@ class TestSystemIP(VyOSUnitTestSHIM.TestCase): _verify_gc_thres(size) def test_system_ip_protocol_route_map(self): - protocols = ['any', 'babel', 'bgp', 'connected', 'eigrp', 'isis', - 'kernel', 'ospf', 'rip', 'static', 'table'] + protocols = ['any', 'babel', 'bgp', 'eigrp', 'isis', 'ospf', 'rip', 'static'] rule_num = '10' diff --git a/smoketest/scripts/cli/test_system_ipv6.py b/smoketest/scripts/cli/test_system_ipv6.py index 0f94765bd..f7d74eb58 100755 --- a/smoketest/scripts/cli/test_system_ipv6.py +++ b/smoketest/scripts/cli/test_system_ipv6.py @@ -97,8 +97,7 @@ class TestSystemIPv6(VyOSUnitTestSHIM.TestCase): _verify_gc_thres(size) def test_system_ipv6_protocol_route_map(self): - protocols = ['any', 'babel', 'bgp', 'connected', 'isis', - 'kernel', 'ospfv3', 'ripng', 'static', 'table'] + protocols = ['any', 'babel', 'bgp', 'isis', 'ospfv3', 'ripng', 'static'] for protocol in protocols: route_map = 'route-map-' + protocol.replace('ospfv3', 'ospf6') diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py index 468b859c3..fee5312e8 100755 --- a/smoketest/scripts/cli/test_vrf.py +++ b/smoketest/scripts/cli/test_vrf.py @@ -40,8 +40,8 @@ from vyos.xml_ref import default_value base_path = ['vrf'] vrfs = ['red', 'green', 'blue', 'foo-bar', 'baz_foo'] -v4_protocols = ['any', 'babel', 'bgp', 'connected', 'eigrp', 'isis', 'kernel', 'ospf', 'rip', 'static', 'table'] -v6_protocols = ['any', 'babel', 'bgp', 'connected', 'isis', 'kernel', 'ospfv3', 'ripng', 'static', 'table'] +v4_protocols = ['any', 'babel', 'bgp', 'eigrp', 'isis', 'ospf', 'rip', 'static'] +v6_protocols = ['any', 'babel', 'bgp', 'isis', 'ospfv3', 'ripng', 'static'] class VRFTest(VyOSUnitTestSHIM.TestCase): _interfaces = [] diff --git a/src/migration-scripts/system/30-to-31 b/src/migration-scripts/system/30-to-31 new file mode 100644 index 000000000..3e57b3db6 --- /dev/null +++ b/src/migration-scripts/system/30-to-31 @@ -0,0 +1,42 @@ +# Copyright VyOS maintainers and contributors <maintainers@vyos.io> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see <http://www.gnu.org/licenses/>. + +# T7644: +# FRR 10.5 doesn't have ip protocols: +# - connected +# - kernel +# - table +# +# Remove them from +# - system ip protocol +# - system ipv6 protocol + +from vyos.configtree import ConfigTree + +bases = [ + ['system', 'ip', 'protocol'], + ['system', 'ipv6', 'protocol'], +] +remove_ip_protocols = ['connected', 'kernel', 'table'] + +def migrate(config: ConfigTree) -> None: + for base in bases: + if not config.exists(base): + continue + + # Iterate over all ip protocols to remove + for protocol in remove_ip_protocols: + if config.exists(base + [protocol]): + config.delete(base + [protocol]) diff --git a/src/migration-scripts/vrf/3-to-4 b/src/migration-scripts/vrf/3-to-4 new file mode 100644 index 000000000..959b736e5 --- /dev/null +++ b/src/migration-scripts/vrf/3-to-4 @@ -0,0 +1,50 @@ +# Copyright VyOS maintainers and contributors <maintainers@vyos.io> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see <http://www.gnu.org/licenses/>. + +# T7664: +# FRR 10.5 doesn't have ip protocols: +# - connected +# - kernel +# - table +# +# Remove them from +# - vrf name VRF ip protocol +# - vrf name VRF ipv6 protocol + +from vyos.configtree import ConfigTree + +subbases = [ + ['ip', 'protocol'], + ['ipv6', 'protocol'], +] +remove_ip_protocols = ['connected', 'kernel', 'table'] + +base = ['vrf', 'name'] + +def migrate(config: ConfigTree) -> None: + if not config.exists(base): + # Nothing to do + return + + for vrf in config.list_nodes(base): + for subbase in subbases: + protocol_base = base + [vrf] + subbase + + if not config.exists(protocol_base): + continue + + for protocol in remove_ip_protocols: + if config.exists(protocol_base + [protocol]): + config.delete(protocol_base + [protocol]) |
