summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def8
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def20
2 files changed, 25 insertions, 3 deletions
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 019978f9..f8bc9270 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
@@ -17,12 +17,14 @@ end:
vtysh -c "configure terminal" \
-c "no ip route $VAR(../@) $VAR(@)"
else
- if [[ -n "$VAR(./distance/@)" ]]
- then
+ if [[ -n "$VAR(./distance/@)" ]]; then
DIST="$VAR(./distance/@)"
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(@) $DIST";
+ -c "ip route $VAR(../@) $VAR(@) $NEXTHOP_VRF $DIST";
fi
else
vtysh -c "configure terminal" \
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
new file mode 100644
index 00000000..c4fee0e0
--- /dev/null
+++ b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
@@ -0,0 +1,20 @@
+type: txt
+help: VRF to leak route
+allowed: local -a params
+ eval "params=($(cli-shell-api listNodes vrf name))"
+ echo -n "${params[@]}"
+val_help: <vrf> ; Name of VRF to leak to
+end:
+ if [[ ${COMMIT_ACTION} = 'DELETE' ]]
+ then
+ if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
+ exit 1;
+ fi
+ if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
+ "$VAR(../../@)" "$VAR(../@)"
+ then
+ VRF_NAME=$VAR(../../../../@)
+ vtysh -c "configure terminal" \
+ -c "no ip route $VAR(../../@) $VAR(../@) nexthop-vrf $VAR(@)"
+ fi
+ fi