summaryrefslogtreecommitdiff
path: root/templates/protocols/vrf
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-09 20:58:09 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-09 20:58:09 +0100
commit96bef2c0c4a1940b0312b07865ab7705ef7a2b32 (patch)
tree4272dcca61865de99b762aa6c99038ed10826789 /templates/protocols/vrf
parentacfbf6315f3c4e2821649ec0a440a62c8d888dd2 (diff)
downloadvyatta-cfg-quagga-96bef2c0c4a1940b0312b07865ab7705ef7a2b32.tar.gz
vyatta-cfg-quagga-96bef2c0c4a1940b0312b07865ab7705ef7a2b32.zip
vrf: T2111: add IPv4 route leaking support
Diffstat (limited to 'templates/protocols/vrf')
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def21
1 files changed, 21 insertions, 0 deletions
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def
new file mode 100644
index 00000000..ad3e92a9
--- /dev/null
+++ b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def
@@ -0,0 +1,21 @@
+type: txt
+help: VRF to leak route
+allowed: local -a params
+ params=('default')
+ eval "params+=($(cli-shell-api listNodes vrf name))"
+ echo -n "${params[@]}"
+val_help: <vrf> ; Name of VRF to leak to
+end:
+ VRF_NAME=$VAR(../../../../@)
+ 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
+ vtysh -c "configure terminal" \
+ -c "no ip route $VAR(../../@) $VAR(../@) vrf $VRF_NAME nexthop-vrf $VAR(@)"
+ fi
+ fi