From 7f6751de3b9480dbf9e6a6a9bf26c51597c4a894 Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Wed, 21 Jul 2021 12:50:04 +0000 Subject: frr: T3685: Add interface option for static table route6 --- .../table/node.tag/route6/node.tag/next-hop/node.def | 18 ++++++++++++++++-- .../node.tag/next-hop/node.tag/interface/node.def | 6 ++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/interface/node.def (limited to 'templates') 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 + -- cgit v1.2.3