diff options
author | hagbard <vyosdev@derith.de> | 2019-05-13 13:23:43 -0700 |
---|---|---|
committer | hagbard <vyosdev@derith.de> | 2019-05-13 13:23:43 -0700 |
commit | 468e19f564023771d774ee32ccffc4ccffed897c (patch) | |
tree | 52414e169f7c73d28f30eb4f0494a3fd7956731e /templates | |
parent | 41df1579f6ca3e5a1618ee85bbb337011148f1ef (diff) | |
download | vyatta-cfg-quagga-468e19f564023771d774ee32ccffc4ccffed897c.tar.gz vyatta-cfg-quagga-468e19f564023771d774ee32ccffc4ccffed897c.zip |
[frr-static] T1267 - Add interface name for static routes
Diffstat (limited to 'templates')
-rw-r--r-- | templates/protocols/static/route/node.tag/next-hop/node.def | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/templates/protocols/static/route/node.tag/next-hop/node.def b/templates/protocols/static/route/node.tag/next-hop/node.def index 0c98eb5f..d70486d3 100644 --- a/templates/protocols/static/route/node.tag/next-hop/node.def +++ b/templates/protocols/static/route/node.tag/next-hop/node.def @@ -4,6 +4,13 @@ help: Next-hop router end: 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 route $VAR(../@) next-hop $VAR(@) next-hop-interface` + vtysh -c "configure terminal" \ + -c "no ip route $VAR(../@) $VAR(@) $OLD_IF $VAR(./distance/@)"; + fi if [[ ${COMMIT_ACTION} = 'DELETE' ]] then if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then @@ -16,16 +23,8 @@ end: -c "no ip route $VAR(../@) $VAR(@)" fi else - if [[ -n "$VAR(./distance/@)" ]] - then - DIST="$VAR(./distance/@)" - fi - if [[ -n "$VAR(./next-hop-interface/@)" ]] - then - NHINT="$VAR(./next-hop-interface/@)" - fi vtysh -c "configure terminal" \ - -c "ip route $VAR(../@) $VAR(@) $NHINT $DIST"; + -c "ip route $VAR(../@) $VAR(@) $VAR(./next-hop-interface/@) $VAR(./distance/@)"; fi else if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \ |