diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-12 20:57:29 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-12-16 22:24:50 +0100 |
commit | d58e7ace7075e24c64cfe5e56ffcaad1688446e9 (patch) | |
tree | 038ca93da2bac49373790c74fb4145adaba19baa | |
parent | a8da54f50df5d60b18a8cdf0ea63c71f82faf14e (diff) | |
download | vyos-1x-d58e7ace7075e24c64cfe5e56ffcaad1688446e9.tar.gz vyos-1x-d58e7ace7075e24c64cfe5e56ffcaad1688446e9.zip |
multicast: T6746: migrate CLI to to mimic unicast IPv4 routes syntax
Consolidate "multicast interface-route" and "multicast route" under common
"mroute <x.x.x.x/y>" CLI node.
-rw-r--r-- | smoketest/config-tests/static-route-basic | 2 | ||||
-rw-r--r-- | smoketest/configs/static-route-basic | 4 | ||||
-rw-r--r-- | src/migration-scripts/quagga/11-to-12 | 21 |
3 files changed, 25 insertions, 2 deletions
diff --git a/smoketest/config-tests/static-route-basic b/smoketest/config-tests/static-route-basic index 4416e6b19..d2d33d043 100644 --- a/smoketest/config-tests/static-route-basic +++ b/smoketest/config-tests/static-route-basic @@ -3,6 +3,8 @@ set interfaces ethernet eth0 speed 'auto' set interfaces ethernet eth0 vif 203 address '172.18.203.10/24' set interfaces ethernet eth1 duplex 'auto' set interfaces ethernet eth1 speed 'auto' +set protocols static mroute 224.1.0.0/24 interface eth0.203 distance '10' +set protocols static mroute 224.2.0.0/24 next-hop 172.18.203.254 distance '20' set protocols static route 10.0.0.0/8 blackhole distance '200' set protocols static route 10.0.0.0/8 blackhole tag '333' set protocols static route 10.0.0.0/8 next-hop 192.0.2.140 bfd multi-hop source-address '192.0.2.10' diff --git a/smoketest/configs/static-route-basic b/smoketest/configs/static-route-basic index 4bf114e33..648e19676 100644 --- a/smoketest/configs/static-route-basic +++ b/smoketest/configs/static-route-basic @@ -14,12 +14,12 @@ interfaces { protocols { static { multicast { - interface-route 224.0.0.0/24 { + interface-route 224.1.0.0/24 { next-hop-interface eth0.203 { distance "10" } } - route 224.0.0.0/24 { + route 224.2.0.0/24 { next-hop 172.18.203.254 { distance "20" } diff --git a/src/migration-scripts/quagga/11-to-12 b/src/migration-scripts/quagga/11-to-12 index becc44162..8ae2023a1 100644 --- a/src/migration-scripts/quagga/11-to-12 +++ b/src/migration-scripts/quagga/11-to-12 @@ -23,6 +23,7 @@ static_base = ['protocols', 'static'] def migrate(config: ConfigTree) -> None: # Check for static route/route6 configuration + # Migrate static BFD configuration to match FRR possibillities for route_route6 in ['route', 'route6']: route_route6_base = static_base + [route_route6] if not config.exists(route_route6_base): @@ -52,3 +53,23 @@ def migrate(config: ConfigTree) -> None: config.delete(multi_hop_base) config.set(multi_hop_base + ['source-address'], value=source) config.set(next_hop_base + [next_hop, 'bfd', 'profile'], value=profile) + + # Consolidate static multicast routing configuration under a new node + if config.exists(static_base + ['multicast']): + for mroute in ['interface-route', 'route']: + mroute_base = static_base + ['multicast', mroute] + if not config.exists(mroute_base): + continue + config.set(static_base + ['mroute']) + config.set_tag(static_base + ['mroute']) + for route in config.list_nodes(mroute_base): + config.copy(mroute_base + [route], static_base + ['mroute', route]) + + mroute_base = static_base + ['mroute'] + if config.exists(mroute_base): + for mroute in config.list_nodes(mroute_base): + interface_path = mroute_base + [mroute, 'next-hop-interface'] + if config.exists(interface_path): + config.rename(interface_path, 'interface') + + config.delete(static_base + ['multicast']) |