summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_static.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2022-12-15 09:59:58 -0500
committerDaniil Baturin <daniil@vyos.io>2022-12-26 13:24:08 -0500
commitdafb0da26d9c27e2a2e836fc56175af5da039479 (patch)
treef086f5a19c529764e92a1918de748355d1c50ae8 /src/conf_mode/protocols_static.py
parent28c7960b6cc9bb05fafb0f2b8659b169b13c0071 (diff)
downloadvyos-1x-dafb0da26d9c27e2a2e836fc56175af5da039479.tar.gz
vyos-1x-dafb0da26d9c27e2a2e836fc56175af5da039479.zip
static: T4883: add a description field for routing tables
Diffstat (limited to 'src/conf_mode/protocols_static.py')
-rwxr-xr-xsrc/conf_mode/protocols_static.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_static.py b/src/conf_mode/protocols_static.py
index 58e202928..cbbc476a7 100755
--- a/src/conf_mode/protocols_static.py
+++ b/src/conf_mode/protocols_static.py
@@ -98,6 +98,15 @@ def generate(static):
return None
def apply(static):
+ ## Put routing table names in /etc/iproute2/rt_tables
+ with open("/etc/iproute2/rt_tables.d/vyos.conf", 'w') as f:
+ print("# Generated by VyOS (protocols_static.py), do not edit by hand", file=f)
+ for t in static['table']:
+ if 'description' in static['table'][t]:
+ print(f"{t}\t{static['table'][t]['description']}", file=f)
+
+ ## Inject routes into FRR
+
static_daemon = 'staticd'
zebra_daemon = 'zebra'