summaryrefslogtreecommitdiff
path: root/src/migration-scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-12-12 20:57:29 +0100
committerChristian Breunig <christian@breunig.cc>2024-12-16 22:24:50 +0100
commitd58e7ace7075e24c64cfe5e56ffcaad1688446e9 (patch)
tree038ca93da2bac49373790c74fb4145adaba19baa /src/migration-scripts
parenta8da54f50df5d60b18a8cdf0ea63c71f82faf14e (diff)
downloadvyos-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.
Diffstat (limited to 'src/migration-scripts')
-rw-r--r--src/migration-scripts/quagga/11-to-1221
1 files changed, 21 insertions, 0 deletions
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'])