From 924887f97bb05ff9819ec0776268e958acd2b2aa Mon Sep 17 00:00:00 2001 From: J vanBemmel Date: Wed, 21 Jun 2023 10:28:49 -0500 Subject: [PATCH] Add SR Linux LocPref template to the BGP routing leaks lab (#20) --- BGP/Route-Leaks/set-pref/srlinux.j2 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 BGP/Route-Leaks/set-pref/srlinux.j2 diff --git a/BGP/Route-Leaks/set-pref/srlinux.j2 b/BGP/Route-Leaks/set-pref/srlinux.j2 new file mode 100644 index 0000000..b9065b6 --- /dev/null +++ b/BGP/Route-Leaks/set-pref/srlinux.j2 @@ -0,0 +1,16 @@ +updates: + +{% for af in ['ipv4','ipv6'] %} +{% for n in bgp.neighbors if n[af] is defined %} + +- path: network-instance[name=default]/protocols/bgp/group[group-name={{n.role|default('')}}] + val: + local-preference: {{ 200 if n.role=='customer' else 150 if n.role=='peer' else 100 }} + _annotate_local-preference: "due to neighbor role '{{ n.role }}'" + +- path: network-instance[name=default]/protocols/bgp/neighbor[peer-address={{n[af]}}] + val: + peer-group: {{ n.role }} + +{% endfor %} +{% endfor %}