Skip to content
VEX-NX

Starter lab: a small BGP leaf-spine

Two spines, two leaves, and a host on each leaf. Free images, short configs, and four checks that tell you the fabric works.

Uses the FRR 10.2.1 and Alpine 3.20 images that ship with VEX-NX, so you need no vendor downloads. Timers and counters in your output will differ from the samples.

Topology

Starter lab topology: two spines, two leaves, two hostsspine1 and spine2 in AS 65000 each connect to leaf1 (AS 65101) and leaf2 (AS 65102) with eBGP over /31 links. host1 attaches to leaf1 on 192.168.11.0/24 and host2 attaches to leaf2 on 192.168.12.0/24.spine1AS 65000spine2AS 65000leaf1AS 65101leaf2AS 65102host1host2

Links and addressing

Endpoint AEndpoint BSubnet
spine1 eth1leaf1 eth110.0.1.0/31
spine1 eth2leaf2 eth110.0.1.2/31
spine2 eth1leaf1 eth210.0.2.0/31
spine2 eth2leaf2 eth210.0.2.2/31
leaf1 eth3host1 eth1192.168.11.0/24
leaf2 eth3host2 eth1192.168.12.0/24

Nodes

NodeImageASNAddress
spine1FRRouting6500010.255.0.1/32
spine2FRRouting6500010.255.0.2/32
leaf1FRRouting6510110.255.1.1/32
leaf2FRRouting6510210.255.1.2/32
host1Alpine–192.168.11.10/24
host2Alpine–192.168.12.10/24

What you need

RoleImageLicenceVersion
Spines and leavesquay.io/frrouting/frr:10.2.1GPL-2.0Seeded offline on current builds
Hostsalpine:3.20FreeSeeded offline on current builds
ApplianceAny VEX-NX install; the minimum sizing (4 vCPU, 8 GB) is enough for this lab.

Build it in VEX-NX

New to the interface? Run the two-node walkthrough in the docs first, then come back.

  1. Step 1

    Check the images

    On Home, confirm Docker is up in Host checks. If Start later reports a missing image, run the seed command on the appliance.

    appliance shell
    $ sudo vexnx-seed-docker$ docker images | grep -E 'frr|alpine'
  2. Step 2

    Create the lab

    Labs → Create blank lab, named leaf-spine. In Design mode, add four frrouting nodes and two alpine nodes, and name them as in the table.

  3. Step 3

    Connect the links

    Connect data ports to match the addressing table. Keep each link on the interface numbers shown so the configs line up.

  4. Step 4

    Start and configure

    Operate → Start all. Open Terminal on each node and apply its startup config: paste the FRR config into vtysh (configure, then paste), and run the host commands in the Alpine shell.

Docs: First lab walkthrough, Design mode, Operate and consoles.

Startup configs

Paste each FRR block after running vtysh and then configure. If router bgp is rejected, bgpd is not running: set bgpd=yes in /etc/frr/daemons and restart the node.

spine1 frr.conf
hostname spine1
!
interface lo
 ip address 10.255.0.1/32
!
interface eth1
 description to leaf1 eth1
 ip address 10.0.1.0/31
!
interface eth2
 description to leaf2 eth1
 ip address 10.0.1.2/31
!
router bgp 65000
 bgp router-id 10.255.0.1
 no bgp ebgp-requires-policy
 neighbor 10.0.1.1 remote-as 65101
 neighbor 10.0.1.3 remote-as 65102
 !
 address-family ipv4 unicast
  network 10.255.0.1/32
  maximum-paths 4
 exit-address-family
!
spine2 frr.conf
hostname spine2
!
interface lo
 ip address 10.255.0.2/32
!
interface eth1
 description to leaf1 eth2
 ip address 10.0.2.0/31
!
interface eth2
 description to leaf2 eth2
 ip address 10.0.2.2/31
!
router bgp 65000
 bgp router-id 10.255.0.2
 no bgp ebgp-requires-policy
 neighbor 10.0.2.1 remote-as 65101
 neighbor 10.0.2.3 remote-as 65102
 !
 address-family ipv4 unicast
  network 10.255.0.2/32
  maximum-paths 4
 exit-address-family
!
leaf1 frr.conf
hostname leaf1
!
interface lo
 ip address 10.255.1.1/32
!
interface eth1
 description to spine1 eth1
 ip address 10.0.1.1/31
!
interface eth2
 description to spine2 eth1
 ip address 10.0.2.1/31
!
interface eth3
 description to host1
 ip address 192.168.11.1/24
!
router bgp 65101
 bgp router-id 10.255.1.1
 no bgp ebgp-requires-policy
 neighbor 10.0.1.0 remote-as 65000
 neighbor 10.0.2.0 remote-as 65000
 !
 address-family ipv4 unicast
  network 10.255.1.1/32
  network 192.168.11.0/24
  maximum-paths 4
 exit-address-family
!
leaf2 frr.conf
hostname leaf2
!
interface lo
 ip address 10.255.1.2/32
!
interface eth1
 description to spine1 eth2
 ip address 10.0.1.3/31
!
interface eth2
 description to spine2 eth2
 ip address 10.0.2.3/31
!
interface eth3
 description to host2
 ip address 192.168.12.1/24
!
router bgp 65102
 bgp router-id 10.255.1.2
 no bgp ebgp-requires-policy
 neighbor 10.0.1.2 remote-as 65000
 neighbor 10.0.2.2 remote-as 65000
 !
 address-family ipv4 unicast
  network 10.255.1.2/32
  network 192.168.12.0/24
  maximum-paths 4
 exit-address-family
!
host1 startup.sh
ip addr add 192.168.11.10/24 dev eth1
ip link set eth1 up
ip route add 192.168.12.0/24 via 192.168.11.1
host2 startup.sh
ip addr add 192.168.12.10/24 dev eth1
ip link set eth1 up
ip route add 192.168.11.0/24 via 192.168.12.1

Verify the fabric

Run each check after the nodes boot.

  1. Check 1 on leaf1

    Both BGP sessions are established on leaf1

    Pass when: Two neighbors, each showing a prefix count (not Idle, Connect, or Active).

    leaf1
    $ vtysh -c "show bgp ipv4 unicast summary"
    Expected output
    Neighbor        V    AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
    10.0.1.0        4 65000        12        11        0    0    0 00:02:31            3        5
    10.0.2.0        4 65000        12        11        0    0    0 00:02:30            3        5
    
    Total number of neighbors 2
  2. Check 2 on leaf1

    leaf1 load-shares toward host2’s subnet across both spines

    Pass when: Two next hops, one through each spine.

    leaf1
    $ vtysh -c "show ip route 192.168.12.0/24"
    Expected output
    Routing entry for 192.168.12.0/24
      Known via "bgp", distance 20, metric 0, best
      * 10.0.1.0, via eth1, weight 1
      * 10.0.2.0, via eth2, weight 1
  3. Check 3 on host1

    host1 reaches host2

    Pass when: 0% packet loss.

    host1
    $ ping -c 3 192.168.12.10
    Expected output
    3 packets transmitted, 3 packets received, 0% packet loss
  4. Check 4 on host1

    The path crosses one spine

    Pass when: Four hops: leaf1, a spine, leaf2, host2. Hop 2 may be 10.0.2.0 instead.

    host1
    $ traceroute -n 192.168.12.10
    Expected output
     1  192.168.11.1
     2  10.0.1.0
     3  10.0.1.3
     4  192.168.12.10

If a check fails

Sessions stuck in Active or Connect
Ping the neighbor address from the leaf. If it fails, the link or the interface address is wrong; compare with the addressing table.
Sessions up, but no prefixes received
Confirm no bgp ebgp-requires-policy is present; FRR otherwise filters eBGP routes without a policy.
Only one next hop toward the remote subnet
Check maximum-paths 4 under the IPv4 address family, and that both spine sessions are established.
Hosts cannot ping each other
Check each host’s route toward the far subnet with ip route.