From db2f0bbeb375e0d568ef4740bad2b50690cd8644 Mon Sep 17 00:00:00 2001 From: sever-sever Date: Sat, 28 Nov 2020 16:11:24 +0000 Subject: op-mode: T3091: Add option tag for blackhole static routes --- .../protocols/static/route/node.tag/blackhole/node.def | 14 +++++++++++--- .../protocols/static/route/node.tag/blackhole/tag/node.def | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 templates/protocols/static/route/node.tag/blackhole/tag/node.def 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 -- cgit v1.2.3