summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-07-21 17:42:03 +0200
committerGitHub <noreply@github.com>2021-07-21 17:42:03 +0200
commitb476983ea129d219d17cfc9c89b986f814288fd8 (patch)
tree0d98703893d0b5c908ea5f5b7cfd0d1b6a8c337b
parent3aefdbce8b8da7278b34e531c6b46a06a4270893 (diff)
parent7f6751de3b9480dbf9e6a6a9bf26c51597c4a894 (diff)
downloadvyatta-cfg-quagga-b476983ea129d219d17cfc9c89b986f814288fd8.tar.gz
vyatta-cfg-quagga-b476983ea129d219d17cfc9c89b986f814288fd8.zip
Merge pull request #85 from sever-sever/T3685
frr: T3685: Add interface option for static table route6
-rw-r--r--templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.def18
-rw-r--r--templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/interface/node.def6
2 files changed, 22 insertions, 2 deletions
diff --git a/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.def b/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.def
index 20514d0f..9d565d4b 100644
--- a/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.def
+++ b/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.def
@@ -11,6 +11,14 @@ end:
fi
if [[ -z "$VAR(./disable)" ]]
then
+ ### remove the old entry from frr first on an update
+ if [ ${COMMIT_ACTION} = 'ACTIVE' ]
+ then
+ OLD_IF=`cli-shell-api returnEffectiveValue protocols static $table route6 $VAR(../@) next-hop $VAR(@) interface`
+ vtysh -c "configure terminal" \
+ -c "no ipv6 route $VAR(../@) $VAR(@) $OLD_IF $VAR(./distance/@) $table";
+ fi
+
if [[ ${COMMIT_ACTION} = 'DELETE' ]]
then
if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 address; then
@@ -19,8 +27,10 @@ end:
if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
"$VAR(../@)" "$VAR(@)"
then
+ DIST=`cli-shell-api returnEffectiveValue protocols static $table route6 $VAR(../@) next-hop $VAR(@) distance`
+ INTERFACE=`cli-shell-api returnEffectiveValue protocols static $table route6 $VAR(../@) next-hop $VAR(@) interface`
vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@) $table"
+ -c "no ipv6 route $VAR(../@) $VAR(@) $INTERFACE $DIST $table";
fi
else
if [[ -n "$VAR(./distance/@)" ]]
@@ -28,8 +38,12 @@ end:
DIST="$VAR(./distance/@)"
fi
+ if [[ -n "$VAR(./interface/@)" ]]; then
+ INTERFACE="$VAR(./interface/@)"
+ fi
+
vtysh -c "configure terminal" \
- -c "ipv6 route $VAR(../@) $VAR(@) $table $DIST";
+ -c "ipv6 route $VAR(../@) $VAR(@) $INTERFACE $DIST $table";
fi
else
if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
diff --git a/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/interface/node.def b/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/interface/node.def
new file mode 100644
index 00000000..c8479a63
--- /dev/null
+++ b/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/interface/node.def
@@ -0,0 +1,6 @@
+type: txt
+help: IPv6 gateway interface name
+# show all current interface
+# but syntax accepts any interface since it may exist later (ppp etc)
+allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
+