From 4620d0485ff635d32946a8222a9d6843ee7d8043 Mon Sep 17 00:00:00 2001 From: Alexey S Date: Fri, 3 Feb 2017 12:11:30 +0100 Subject: [PATCH] Create default.j2 --- roles/vrf/templates/default.j2 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 roles/vrf/templates/default.j2 diff --git a/roles/vrf/templates/default.j2 b/roles/vrf/templates/default.j2 new file mode 100644 index 0000000..27d8f17 --- /dev/null +++ b/roles/vrf/templates/default.j2 @@ -0,0 +1,24 @@ +! +{% for vpn in item.vpns %} +vrf {{ vpn.name }} + address-family ipv4 unicast + import route-target {{ item.as_number }}:{{ vpn.iRT }} + export route-target {{ item.as_number }}:{{ vpn.eRT }} +! +{% endfor %} +router static +{% for vpn in item.vpns %} +vrf {{ vpn.name }} + address-family ipv4 unicast + 0.0.0.0/0 Null0 description Default_route_for_VPN_{{vpn.name}} +{% endfor %} +! +router bgp {{ item.as_number }} +{% for vpn in item.vpns %} +vrf {{ vpn.name }} + rd {{ item.as_number }}:{{ vpn.RD }} + default-information originate + address-family ipv4 unicast + redistribute connected + redistribute static +{% endfor %}