summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def15
1 files changed, 12 insertions, 3 deletions
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def
index ec7a9eed..67842168 100644
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def
+++ b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def
@@ -3,8 +3,7 @@ type: ipv4
help: Next-hop router
end:
VRF_NAME=$VAR(../../../@)
- if [[ -z "$VAR(./disable)" ]]
- then
+ if [[ -z "$VAR(./disable)" ]]; then
### remove the old entry from frr first on an update
if [ ${COMMIT_ACTION} = 'ACTIVE' ]
then
@@ -24,8 +23,18 @@ end:
-c "no ip route $VAR(../@) $VAR(@) vrf $VRF_NAME"
fi
else
+ if [[ -n "$VAR(./distance/@)" ]]; then
+ DIST="$VAR(./distance/@)"
+ fi
+ if [[ -n "$VAR(./next-hop-interface/@)" ]]; then
+ NEXTHOP_INT="$VAR(./next-hop-interface/@)"
+ fi
+ if [[ -n "$VAR(./next-hop-vrf/@)" ]]; then
+ NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
+ fi
vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $VAR(@) $VAR(./next-hop-interface/@) vrf $VRF_NAME $VAR(./distance/@)";
+ -c "vrf $VRF_NAME" \
+ -c "ip route $VAR(../@) $VAR(@) $NEXTHOP_INT $NEXTHOP_VRF $DIST";
fi
else
if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \