Skip to content

Commit ab57a18

Browse files
authored
Implement bgp.advertise on Nexus OS (#3273)
1 parent 8af53df commit ab57a18

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

netsim/ansible/templates/bgp/nxos.j2

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,8 @@ router bgp {{ bgp.as }}
1515
!
1616
address-family {{ af }} unicast
1717
!
18-
{% if loopback[af] is defined and bgp.advertise_loopback %}
19-
network {{ loopback[af]|ansible.utils.ipaddr(0) }}
20-
{% endif %}
21-
!
22-
{% for l in interfaces|default([]) if l.bgp.advertise|default("") and l[af] is defined and not 'vrf' in l %}
23-
network {{ l[af]|ansible.utils.ipaddr(0) }}
24-
{% endfor %}
25-
!
26-
{% for pfx in bgp.originate|default([]) if af == 'ipv4' %}
27-
network {{ pfx|ansible.utils.ipaddr('0') }}
18+
{% for pfx in bgp.advertise|default([]) if af in pfx %}
19+
network {{ pfx[af] }}
2820
{% endfor %}
2921
{% endfor %}
3022
!

netsim/ansible/templates/vrf/nxos.bgp.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ router bgp {{ bgp.as }}
1515
{% if af == 'ipv4' and 'ospf' in vdata %}
1616
redistribute ospf {{ vdata.vrfidx }} route-map all
1717
{% endif %}
18-
{% for n in vdata.networks|default([]) if af in n %}
19-
network {{ n[af]|ansible.utils.ipaddr('0') }}
18+
{% for pfx in vdata.bgp.advertise|default([]) if af in pfx %}
19+
network {{ pfx[af] }}
2020
{% endfor %}
2121
!
2222
{% for n in vdata.bgp.neighbors|default([]) if af in n %}

netsim/devices/nxos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ features:
3939
generate_mac: [ ethernet ]
4040
bfd: true
4141
bgp:
42+
advertise: true
4243
allowas_in: true
4344
as_override: true
4445
default_originate: true

0 commit comments

Comments
 (0)