30 Leaf-spine fabric with BGP
A data center fabric: two spines, two leaves and two servers, with BGP unnumbered and equal-cost paths.
What you practice
- BGP unnumbered: peering over IPv6 link-local addresses, no addresses on fabric links
- Equal-cost multipath (ECMP) through both spines
- Losing a spine link without losing traffic
- Checking a whole fabric with one Ansible playbook
Topology
| Node | Image | CPUs / memory | Addresses | Role |
|---|---|---|---|---|
spine1 | debian-13 | 1 / 768MiB | mgmt 10.130.0.11 | Spine, AS 65000 |
spine2 | debian-13 | 1 / 768MiB | mgmt 10.130.0.12 | Spine, AS 65000 |
leaf1 | debian-13 | 1 / 768MiB | mgmt 10.130.0.13; host 192.168.1.1/24 | Leaf, AS 65011 |
leaf2 | debian-13 | 1 / 768MiB | mgmt 10.130.0.14; host 192.168.2.1/24 | Leaf, AS 65012 |
server1 | debian-13 | 1 / 768MiB | mgmt 10.130.0.15; lan 192.168.1.10/24 | Server under leaf1 |
server2 | debian-13 | 1 / 768MiB | mgmt 10.130.0.16; lan 192.168.2.10/24 | Server under leaf2 |
Before you start
bash
vz image pull disk debian-13Run it
bash
cd examples/30-leaf-spine-bgp
vz validate
vz up
vz node ls
ssh lab@10.130.0.11 # password: labFirst boot installs packages; give it a minute or two after vz up returns.
Try it
bash
ssh lab@10.130.0.13 "sudo vtysh -c 'show bgp summary' -c 'show ip route 192.168.2.0/24'" # two next hops
ssh lab@10.130.0.15 'traceroute -n 192.168.2.10'
ssh lab@10.130.0.16 'iperf3 -s -D'
ssh lab@10.130.0.15 'iperf3 -c 192.168.2.10 -t 30' &
vz link down s1-l1 # leaf1 keeps going through spine2
ssh lab@10.130.0.13 "sudo vtysh -c 'show ip route 192.168.2.0/24'" # one next hop left
vz link up s1-l1Ansible: check the fabric
On the Mac:
- ansible:
brew install ansible
bash
cd ansible
chmod 600 lab_key
ansible-playbook fabric-check.yml # all green
vz link down s2-l2
ansible-playbook fabric-check.yml # spine2 and leaf2 report the broken session
vz link up s2-l2Notes
Six nodes at 768MiB each: about 5 GiB of memory in total.
The key pair in ansible/ was generated for this example and is public now: use it only in this lab. Git does not keep file modes, so run chmod 600 ansible/lab_key once, or ssh refuses the key.
Clean up
bash
vz down
vz destroy --yes # deletes the overlays and state of this lab