Skip to content

Commit dbde9fe

Browse files
committed
BGP confederations on Dell OS10, EOS, FRR, and IOS
Based on work done by @jbemmel in #2426
1 parent 117debc commit dbde9fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+748
-71
lines changed

docs/module/bgp.md

Lines changed: 92 additions & 48 deletions
Large diffs are not rendered by default.

netsim/ansible/templates/bgp/dellos10.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ router bgp {{ bgp.as }}
1515
{% if bgp.router_id|ipv4 %}
1616
router-id {{ bgp.router_id }}
1717
{% endif %}
18+
{% if bgp.confederation is defined %}
19+
confederation identifier {{ bgp.confederation.as }}
20+
confederation peers {{ bgp.confederation.peers|join(' ') }}
21+
{% endif %}
1822
{% if bgp.rr|default(False) and bgp.rr_cluster_id|default(False) %}
1923
cluster-id {{ bgp.rr_cluster_id }}
2024
{% endif %}

netsim/ansible/templates/bgp/dellos10.macro.j2

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,20 @@
2121
{% if n._source_intf is defined %}
2222
update-source {{ n._source_intf.ifname }}
2323
{% endif %}
24-
{% if 'ibgp' in n.type %}
25-
{% if bgp.next_hop_self is defined and bgp.next_hop_self %}
24+
{% if n.type in ['ibgp','localas_ibgp','confed_ebgp'] and bgp.next_hop_self|default(False) %}
2625
{#
2726
In Dell OS10, next-hop-self is configured under AF
2827
#}
29-
{% for af in ['ipv4','ipv6'] if n.activate[af]|default(False) and (af == t_af or unnumbered) %}
28+
{% for af in ['ipv4','ipv6'] if n.activate[af]|default(False) and (af == t_af or unnumbered) %}
3029
!
3130
address-family {{ af }} unicast
3231
next-hop-self
3332
exit
34-
{% endfor %}
35-
{% endif -%}
36-
37-
{% if bgp.rr|default('') and not n.rr|default('') %}
33+
{% endfor %}
34+
{% endif %}
35+
{% if 'ibgp' in n.type and bgp.rr|default('') and not n.rr|default('') %}
3836
route-reflector-client
39-
{% endif %}
40-
{% endif -%}
41-
37+
{% endif %}
4238
{% if n.type in bgp.community %}
4339
{% for comm in ['standard','extended'] %}
4440
{% if comm in bgp.community[n.type] %}

netsim/ansible/templates/bgp/eos.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ router bgp {{ bgp.as }}
4343
bgp log-neighbor-changes
4444
no bgp default ipv4-unicast
4545
no bgp default ipv6-unicast
46+
{% if bgp.confederation is defined %}
47+
bgp confederation identifier {{ bgp.confederation.as }}
48+
bgp confederation peers {{ bgp.confederation.peers|join(' ') }}
49+
{% endif %}
4650
{% if bgp.router_id|ipv4 %}
4751
router-id {{ bgp.router_id }}
4852
{% endif %}
@@ -79,6 +83,9 @@ router bgp {{ bgp.as }}
7983
{% if n.type == 'ibgp' and bgp.next_hop_self|default(False) %}
8084
neighbor {{ peer }} route-map next-hop-self-{{ af }} out
8185
{% endif %}
86+
{% if n.type == 'confed_ebgp' and bgp.next_hop_self|default(False) %}
87+
neighbor {{ peer }} next-hop-self
88+
{% endif %}
8289
{% if n.type == 'localas_ibgp' %}
8390
neighbor {{ peer }} next-hop-self
8491
neighbor {{ peer }} route-reflector-client

netsim/ansible/templates/bgp/frr.j2

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ router bgp {{ bgp.as }}
55
no bgp default ipv4-unicast
66
bgp default show-hostname
77
bgp default show-nexthop-hostname
8-
8+
{% if bgp.confederation is defined %}
9+
bgp confederation identifier {{ bgp.confederation.as }}
10+
bgp confederation peers {{ bgp.confederation.peers|join(' ') }}
11+
{% endif %}
912
! Consider AS paths of same length but with different AS as ECMP candidates
1013
bgp bestpath as-path multipath-relax
1114

@@ -65,13 +68,11 @@ router bgp {{ bgp.as }}
6568
else False %}
6669
{% if peer %}
6770
neighbor {{ peer }} activate
68-
{% if n.type == 'ibgp' %}
69-
{% if bgp.next_hop_self is defined and bgp.next_hop_self %}
71+
{% if n.type in ['ibgp','confed_ebgp'] and bgp.next_hop_self|default(False) %}
7072
neighbor {{ peer }} next-hop-self
71-
{% endif %}
72-
{% if bgp.rr|default('') and not n.rr|default('') %}
73+
{% endif %}
74+
{% if n.type == 'ibgp' and bgp.rr|default('') and not n.rr|default('') %}
7375
neighbor {{ peer }} route-reflector-client
74-
{% endif %}
7576
{% endif %}
7677
{% if n.type == 'localas_ibgp' %}
7778
neighbor {{ peer }} route-reflector-client

netsim/ansible/templates/bgp/ios.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ router bgp {{ bgp.as }}
99
bgp update-delay 5
1010
bgp nopeerup-delay cold-boot 1
1111
bgp nopeerup-delay user-initiated 1
12+
{% if bgp.confederation is defined %}
13+
bgp confederation identifier {{ bgp.confederation.as }}
14+
bgp confederation peers {{ bgp.confederation.peers|join(' ') }}
15+
{% endif %}
1216
{% if bgp.router_id|ipv4 %}
1317
bgp router-id {{ bgp.router_id }}
1418
{% endif %}

netsim/ansible/templates/bgp/ios.macro.j2

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919
{% macro neighbor_af(n,ip,bgp) %}
2020
neighbor {{ ip }} activate
2121
neighbor {{ ip }} advertisement-interval 0
22-
{% if n.type == 'ibgp' %}
23-
{% if bgp.next_hop_self is defined and bgp.next_hop_self %}
22+
{% if n.type in ['ibgp','confed_ebgp'] and bgp.next_hop_self|default(False) %}
2423
neighbor {{ ip }} next-hop-self
25-
{% endif %}
26-
{% if bgp.rr|default('') and (not n.rr|default('') or n.type == 'localas_ibgp') %}
24+
{% endif %}
25+
{% if n.type == 'ibgp' and bgp.rr|default('') and (not n.rr|default('') %}
2726
neighbor {{ ip }} route-reflector-client
28-
{% endif %}
2927
{% endif %}
3028
{% if n.type == 'localas_ibgp' %}
3129
neighbor {{ ip }} route-reflector-client

netsim/devices/dellos10.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ features:
2020
local_as_ibgp: false # Device fails to send correct local AS (only)
2121
vrf_local_as: true
2222
import: [ ospf, connected, static, vrf ]
23+
confederation: True
2324
evpn:
2425
asymmetrical_irb: true
2526
irb: true

netsim/devices/eos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ features:
3838
large: [ large ]
3939
extended: [ extended ]
4040
2octet: [ standard ]
41+
confederation: True
4142
dhcp:
4243
client:
4344
ipv4: true

netsim/devices/frr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ features:
7272
large: [ large ]
7373
extended: [ extended ]
7474
2octet: [ standard ]
75+
confederation: True
7576
evpn:
7677
irb: true
7778
asymmetrical_irb: True

0 commit comments

Comments
 (0)