From a753e52319bd44602fd991dc8ade5fce9f4dc12b Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 30 Mar 2020 15:54:49 +0200 Subject: vrf: T2170: IPv6 support route-leaking on interface routes --- .../node.tag/next-hop-interface/node.def | 16 +++++++++++----- .../next-hop-interface/node.tag/next-hop-vrf/node.def | 7 +++++++ 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def (limited to 'templates/protocols') diff --git a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.def b/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.def index 03cf2257..52f198b1 100644 --- a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.def +++ b/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.def @@ -16,16 +16,22 @@ end: fi vtysh -c "configure terminal" \ - -c "no ipv6 route $VAR(../@) $VAR(@) vrf $VRF_NAME" + -c "vrf $VRF_NAME" \ + -c "no ipv6 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 "ipv6 route $VAR(../@) $VAR(@) vrf $VRF_NAME $DIST"; + -c "vrf $VRF_NAME" \ + -c "ipv6 route $VAR(../@) $VAR(@) $NEXTHOP_VRF $DIST"; fi else vtysh -c "configure terminal" \ - -c "no ipv6 route $VAR(../@) vrf $VRF_NAME $VAR(@)" + -c "vrf $VRF_NAME" \ + -c "no ipv6 route $VAR(../@) $VAR(@)" fi diff --git a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def b/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def new file mode 100644 index 00000000..7eee837e --- /dev/null +++ b/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def @@ -0,0 +1,7 @@ +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: ; Name of VRF to leak to -- cgit v1.2.3