Skip to content

Commit

Permalink
Multi-platform BGP anycast example
Browse files Browse the repository at this point in the history
  • Loading branch information
ipspace committed Apr 7, 2022
1 parent 33215e8 commit 9612331
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 0 deletions.
11 changes: 11 additions & 0 deletions multi-platform/bgp-anycast/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Multi-Platform BGP Anycast Lab

This lab illustrates the *netsim-tools* multi-platform custom configuration templates.

![Lab topology](multi-platform-bgp-anycast.png)

Notes:
* Anycast nodes are a mix of Cisco IOSv, Arista vEOS, and Cumulus VX
* Leaf nodes are a mix of Cisco IOSv and Arista vEOS
* Anycast configuration templates are in the `bgp-anycast` directory
* *BGP Additional Paths* configuration templates are in the `bgp-addpath` directory
6 changes: 6 additions & 0 deletions multi-platform/bgp-anycast/bgp-addpath/eos.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
router bgp {{ bgp.as }}
maximum-paths 16
bgp additional-paths install ecmp-primary
{% for n in bgp.neighbors if n.type == 'ibgp' %}
neighbor {{ n.ipv4 }} additional-paths send any
{% endfor %}
9 changes: 9 additions & 0 deletions multi-platform/bgp-anycast/bgp-addpath/ios.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
router bgp {{ bgp.as }}
address-family ipv4 unicast
bgp additional-paths select all
bgp additional-paths send receive
maximum-paths 16
maximum-paths ibgp 16
{% for n in bgp.neighbors if n.type == 'ibgp' %}
neighbor {{ n.ipv4 }} advertise additional-paths all
{% endfor %}
8 changes: 8 additions & 0 deletions multi-platform/bgp-anycast/bgp-anycast/cumulus.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if bgp is defined and bgp.anycast is defined %}
interface lo
ip address {{ bgp.anycast }} label anycast
!
router bgp {{ bgp.as }}
address-family ipv4
network {{ bgp.anycast|ipaddr('0') }}
{% endif %}
8 changes: 8 additions & 0 deletions multi-platform/bgp-anycast/bgp-anycast/eos.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if bgp is defined and bgp.anycast is defined %}
interface loopback 42
ip address {{ bgp.anycast }}
!
router bgp {{ bgp.as }}
address-family ipv4
network {{ bgp.anycast|ipaddr('0') }}
{% endif %}
8 changes: 8 additions & 0 deletions multi-platform/bgp-anycast/bgp-anycast/ios.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if bgp is defined and bgp.anycast is defined %}
interface loopback 42
ip address {{ bgp.anycast|ipaddr('address') }} {{ bgp.anycast|ipaddr('netmask') }}
!
router bgp {{ bgp.as }}
address-family ipv4
network {{ bgp.anycast|ipaddr('address') }} mask {{ bgp.anycast|ipaddr('netmask') }}
{% endif %}
51 changes: 51 additions & 0 deletions multi-platform/bgp-anycast/graph.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
graph {
bgcolor="transparent"
node [shape=box, style="rounded,filled" fontname=Verdana]
edge [fontname=Verdana labelfontsize=10 labeldistance=1.5]
subgraph cluster_65000 {
bgcolor="#e8e8e8"
fontname=Verdana
margin=16
label="AS 65000"
l1 [
label=<l1 [iosv]<br /><sub>10.0.0.1/32</sub>>
fillcolor="#ff9f01"
]
l2 [
label=<l2 [eos]<br /><sub>10.0.0.2/32</sub>>
fillcolor="#ff9f01"
]
l3 [
label=<l3 [iosv]<br /><sub>10.0.0.3/32</sub>>
fillcolor="#ff9f01"
]
s1 [
label=<s1 [iosv]<br /><sub>10.0.0.4/32</sub>>
fillcolor="#ff9f01"
]
}
subgraph cluster_65101 {
bgcolor="#e8e8e8"
fontname=Verdana
margin=16
label="AS 65101"
a1 [
label=<a1 [iosv]<br /><sub>10.0.0.5/32</sub>>
fillcolor="#ff9f01"
]
a2 [
label=<a2 [eos]<br /><sub>10.0.0.6/32</sub>>
fillcolor="#ff9f01"
]
a3 [
label=<a3 [cumulus]<br /><sub>10.0.0.7/32</sub>>
fillcolor="#ff9f01"
]
}
l1 -- s1 [ ]
l2 -- s1 [ ]
l3 -- s1 [ ]
a1 -- l2 [ ]
a2 -- l2 [ ]
a3 -- l3 [ ]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions multi-platform/bgp-anycast/topology.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Baseline OSPF+BGP topology
#
# Anycast nodes are in AS 65101, core network is AS 65000
# Anycast prefixes are advertised via EBGP
#

module: [ ospf, bgp ]
defaults.bgp.extra_attributes.node: [ anycast ]

bgp:
as_list:
65000:
members: [ l1, l2, l3, s1 ]
rr: [ s1 ]
65101:
members: [ a1,a2,a3 ]

groups:
as65000:
config: [ bgp-addpath ]
as65101:
config: [ bgp-anycast ]
node_data:
bgp.anycast: 10.42.42.42/32
bgp.advertise_loopback: False

defaults.device: iosv

nodes:
l1:
l2:
device: eos
l3:
s1:
a1:
a2:
device: eos
a3:
device: cumulus

links: [ s1-l1, s1-l2, s1-l3, l2-a1, l2-a2, l3-a3 ]

0 comments on commit 9612331

Please sign in to comment.