summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2020-11-28 23:28:04 +0700
committerGitHub <noreply@github.com>2020-11-28 23:28:04 +0700
commita6188249200ea2daf7861ea790a52fbdadd9b941 (patch)
treef7064a687674cebb053ac60347e5e548d8cea45c
parentbb294a0f502cd5c92ec5d118c45c5fa7761c010a (diff)
parentdb2f0bbeb375e0d568ef4740bad2b50690cd8644 (diff)
downloadvyatta-cfg-quagga-a6188249200ea2daf7861ea790a52fbdadd9b941.tar.gz
vyatta-cfg-quagga-a6188249200ea2daf7861ea790a52fbdadd9b941.zip
Merge pull request #57 from sever-sever/T3091
op-mode: T3091: Add option tag for blackhole static routes
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/node.def14
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/tag/node.def4
2 files changed, 15 insertions, 3 deletions
diff --git a/templates/protocols/static/route/node.tag/blackhole/node.def b/templates/protocols/static/route/node.tag/blackhole/node.def
index a7208dfa..b513e27b 100644
--- a/templates/protocols/static/route/node.tag/blackhole/node.def
+++ b/templates/protocols/static/route/node.tag/blackhole/node.def
@@ -9,8 +9,16 @@ end: if [ ${COMMIT_ACTION} = 'DELETE' ]; then
-c "no ip route $VAR(../@) Null0";
else
if [ -n "$VAR(./distance/@)" ]; then
- DIST="$VAR(./distance/@)";
+ DIST="$VAR(./distance/@)";
+ fi
+ if [ -n "$VAR(./tag/@)" ]; then
+ TAG="$VAR(./tag/@)";
+ fi;
+ if [[ -z $TAG ]]; then
+ vtysh -c "configure terminal" \
+ -c "ip route $VAR(../@) Null0 $DIST";
+ else
+ vtysh -c "configure terminal" \
+ -c "ip route $VAR(../@) Null0 tag $TAG $DIST";
fi;
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) Null0 $DIST";
fi;
diff --git a/templates/protocols/static/route/node.tag/blackhole/tag/node.def b/templates/protocols/static/route/node.tag/blackhole/tag/node.def
new file mode 100644
index 00000000..778952ea
--- /dev/null
+++ b/templates/protocols/static/route/node.tag/blackhole/tag/node.def
@@ -0,0 +1,4 @@
+type: u32
+help: Tag value for this route
+syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967295; "Must be between (1-4294967295)"
+val_help: u32:1-4294967295; Tag for this route