Skip to content

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 ​

NodeImageCPUs / memoryAddressesRole
spine1debian-131 / 768MiBmgmt 10.130.0.11Spine, AS 65000
spine2debian-131 / 768MiBmgmt 10.130.0.12Spine, AS 65000
leaf1debian-131 / 768MiBmgmt 10.130.0.13; host 192.168.1.1/24Leaf, AS 65011
leaf2debian-131 / 768MiBmgmt 10.130.0.14; host 192.168.2.1/24Leaf, AS 65012
server1debian-131 / 768MiBmgmt 10.130.0.15; lan 192.168.1.10/24Server under leaf1
server2debian-131 / 768MiBmgmt 10.130.0.16; lan 192.168.2.10/24Server under leaf2

Before you start ​

bash
vz image pull disk debian-13

Run it ​

bash
cd examples/30-leaf-spine-bgp
vz validate
vz up
vz node ls
ssh lab@10.130.0.11        # password: lab

First 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-l1

Ansible: 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-l2

Notes ​

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