Skip to content

Commit 3202988

Browse files
authored
Cumulus NVUE: Add initial limited bgp.session support for allowas_in (#1968)
Used by one of the EVPN test cases
1 parent 3572aa0 commit 3202988

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

docs/plugins/bgp.session.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ The plugin implements AS-path-mangling nerd knobs for the following platforms:
110110
| Cisco IOSv/IOSvL2 ||||||
111111
| Cisco IOS-XE[^18v] ||||||
112112
| Cisco Nexus OS ||||||
113-
| Cumulus Linux ||||||
113+
| Cumulus Linux 4.x ||||||
114+
| Cumulus 5.x (NVUE) ||||||
114115
| FRR ||||||
115116
| Junos[^Junos] ||||||
116117
| Mikrotik RouterOS 7 ||||||
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
{% macro ebgp_neighbor(n) -%}
3+
aspath:
4+
allow-my-asn:
5+
enable: {{ 'on' if n.allowas_in|default(False) else 'off' }}
6+
{% if n.allowas_in|default(0) > 0 %}
7+
occurrences: {{ n.allowas_in }}
8+
{% endif %}
9+
{% endmacro %}
10+
11+
{% macro ebgp_config(vrf,vrf_bgp) -%}
12+
{% for n in vrf_bgp.neighbors %}
13+
{% if loop.first %}
14+
- set:
15+
vrf:
16+
{{ vrf }}:
17+
router:
18+
bgp:
19+
neighbor:
20+
{% endif %}
21+
{% for a in ['ipv4','ipv6','local_if'] if a in n and n[a] is string %}
22+
{{ n[a] }}:
23+
address-family:
24+
{% for af in ['ipv4','ipv6'] if af in vrf_bgp %}
25+
{{ af }}-unicast:
26+
{{ ebgp_neighbor(n)|indent(20,first=True) }}
27+
{% endfor %}
28+
{% if 'evpn' in n %}
29+
l2vpn-evpn:
30+
{{ ebgp_neighbor(n)|indent(20,first=True) }}
31+
{% endif %}
32+
{% endfor %}
33+
{% endfor %}
34+
{% endmacro %}
35+
36+
{{ ebgp_config('default',bgp) }}
37+
38+
{% if vrfs is defined %}
39+
{% for vname,vdata in vrfs.items() if vdata.bgp is defined and vdata.bgp.neighbors is defined %}
40+
{{ ebgp_config(vname,vdata.bgp) }}
41+
{% endfor %}
42+
{% endif %}

netsim/extra/bgp.session/defaults.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ devices:
3535
timers: True
3636
cumulus:
3737
copy: frr
38+
cumulus_nvue.features.bgp:
39+
allowas_in: True
3840
iosv.features.bgp:
3941
allowas_in: True
4042
as_override: True

0 commit comments

Comments
 (0)