Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion netsim/ansible/templates/mpls/srlinux.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
updates:
{% if ldp is defined %}
{% include 'srlinux.ldp.j2' +%}
{% include 'srlinux/ldp.j2' +%}
{% endif %}
{% if mpls.vpn is defined %}
{% include 'srlinux/vpn.j2' +%}
{% endif %}
44 changes: 44 additions & 0 deletions netsim/ansible/templates/mpls/srlinux/vpn.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
- path: /system/mpls/label-ranges/dynamic[name=vpn]
value:
start-label: 20000
end-label: 30000

- path: /system/mpls/services
value:
network-instance:
dynamic-label-block: vpn

{% for af in ['ipv4','ipv6'] if mpls.vpn[af] is defined %}
{% if loop.first %}
- path: /network-instance[name=default]/protocols/bgp
value:
afi-safi:
{% endif %}
- afi-safi-name: l3vpn-{{ af }}-unicast
admin-state: enable
l3vpn-{{ af }}-unicast:
rapid-update: True
keep-all-routes: True
{% endfor %}
{% for n_type in ['ibgp','ebgp'] %}
{% for af in ['ipv4','ipv6'] if n_type in mpls.vpn[af]|default([]) %}
{% if loop.first %}
- path: /network-instance[name=default]/protocols/bgp/group[group-name={{ n_type }}-ipv4]
value:
afi-safi:
{% endif %}
- afi-safi-name: l3vpn-{{ af }}-unicast
admin-state: enable
send-community-type: [ standard, extended ]
{% endfor %}
{% endfor %}
{% for v_name,v_data in vrfs|default({})|dictsort %}
- path: /network-instance[name={{ v_name }}]/protocols/bgp-ipvpn
value:
bgp-instance:
- id: 1
admin-state: enable
mpls:
next-hop-resolution:
allowed-tunnel-types: [ ldp, sr-isis ]
{% endfor %}
15 changes: 11 additions & 4 deletions netsim/ansible/templates/vrf/srlinux.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,17 @@ updates:

- path: /network-instance[name={{vname}}]/protocols/bgp-vpn
value:
bgp-instance:
- id: 1
route-distinguisher:
rd: "{{ vdata.rd }}"
bgp-instance:
- id: 1
route-distinguisher:
rd: "{{ vdata.rd }}"
route-target:
{% if vdata.import %}
import-rt: "target:{{ vdata.import[0] }}"
{% endif %}
{% if vdata.export %}
export-rt: "target:{{ vdata.export[0] }}"
{% endif %}

{% if vdata.export|default([]) and vdata.import|default([]) %}
- path: /network-instance[name={{vname}}]/inter-instance-policies
Expand Down
5 changes: 3 additions & 2 deletions netsim/devices/srlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ features:
ipv6: True
network: True
import: [ ospf, bgp, connected, static, vrf, no_policy ]
mpls:
ldp: True # on 7250 IXR only
mpls: # on 7250 IXR only
ldp: True
vpn: True
ospf:
unnumbered: True
import: [ bgp, isis, connected, static, vrf, no_policy ]
Expand Down