One solution for it:
vyos_bld@3c88687662fe:/vyos/work/T3516/vyatta-cfg-quagga$ git diff diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def index f8bc9270..991a30ee 100644 --- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def +++ b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def @@ -14,7 +14,10 @@ end: if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 interface; then exit 1; fi + DIST=`cli-shell-api returnEffectiveValue protocols static interface-route $VAR(../@) next-hop-interface $VAR(@) distance` + vtysh -c "configure terminal" \ + -c "no ip route $VAR(../@) $VAR(@) $DIST" \ -c "no ip route $VAR(../@) $VAR(@)" else if [[ -n "$VAR(./distance/@)" ]]; then 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 0574781d..44a39bfb 100644 --- a/templates/protocols/static/route/node.tag/next-hop/node.def +++ b/templates/protocols/static/route/node.tag/next-hop/node.def @@ -16,10 +16,12 @@ end: if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then exit 1; fi + DIST=`cli-shell-api returnEffectiveValue protocols static route $VAR(../@) next-hop $VAR(@) distance` if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \ "$VAR(../@)" "$VAR(@)" then vtysh -c "configure terminal" \ + -c "no ip route $VAR(../@) $VAR(@) $DIST" \ -c "no ip route $VAR(../@) $VAR(@)" fi else