diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-23 14:09:34 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-23 14:09:34 +0200 |
commit | edeebf4e82e3f750d35ed19e137b877b6149f107 (patch) | |
tree | 759c8bd7429e51da19eeab87b718ce8992e00dc6 /templates | |
parent | 08f3e4353561962a5d76a7db901de9d215e466e2 (diff) | |
download | vyatta-cfg-quagga-edeebf4e82e3f750d35ed19e137b877b6149f107.tar.gz vyatta-cfg-quagga-edeebf4e82e3f750d35ed19e137b877b6149f107.zip |
vrf: T2369: support leaking interface-route from default VRF
Diffstat (limited to 'templates')
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 |