BGP minilab

This is a small lab environment to run the configuration examples from my book:

Installing the minilab

Install the minilab on your own computer as follows:

Network topology used in the examples

Running the minilab

You can then use the following scripts:

Examples, Mac/Linux:
./start.sh noconverge

./start.sh example 1

./start.sh example keeprunning 1

./start.sh example 1 detach

./connectrouter.sh Router82

./connectrouter.sh 82 bash

./connectrouter.sh 82 show ip bgp summary

./stoprouters.sh
Examples, Windows:
.\start.ps1 noconverge

.\start.ps1 example 1

.\start.ps1 example keeprunning 1

.\start.ps1 example 1 detach

.\connectrouter.ps1 Router82

.\connectrouter.ps1 82 bash

.\connectrouter.ps1 82 show ip bgp summary

.\stoprouters.ps1
The "noconverge" lab is a BGP setup with four routers with policies such that BGP never converges. Type
show ip bgp
every two seconds or so and you see how the BGP table keeps changing.

Creating labs

To create your own labs, do the following: This is an example of a settings.txt file with all of the settings that are supported.
# default settings (need to go on top!)
#
# routers to start as part of the lab
default routers 10 20 30 40 83 82
#
# which router to connect to on startup
# empty means the lab runs in detached mode
default attach 82
#
# text displayed on lab startup
default txt Hi!
#
# Below are the Docker image settings. These overrule
# the same settings in the start script, so they are
# normally not required.
#
# docker image to use
default dockerimage frrouting/frr:v8.3.1
#
# location of configs in Docker image
default configdir /etc/frr
#
# extra commands to run in the container at startup
default startup
(Note that comments are only possible at the beginnen of a line!)

Variations

If you want to have variations of the same lab, create a directory "0" inside the main lab directory and move everything to that 0 directory. You can now make a copy of the 0 directory, perhaps naming it "1". Then, run the "1" variant of the lab as follows:
./start.sh lab 1
If you save your configurations, those go inside sub-lab 1. You can then make a copy of 1 and make further changes to the copy and so on.

If a variation needs settings that are different from the default settings, add them to the settings.txt file:

# variant 1
1 routers 10 20 30 40 83 90 95 96 82
1 attach 90
1 txt This is lab 1.

If some routers have the same configuration in all or most variants of the lab, you can remove the directories of those routers from the variant directory, and the version in the "0" directory will be used instead. This is indicated by (router) at startup. This way you can change the configuration in 0 and all the variants will inherit that change.

An advantage of using the 0 configurations is that if you start a new variant of the lab while another is already running, only routers actually present in that variant will be restarted. This is indicated by {router} at startup.

See the "example" lab for how all of this works. Run them with:

.\start.ps1 example 1
...
./start.sh example 5

HyperV won't start under Windows on a Mac

This is a misleading error message. See here for the solution.

Version: 1.0 2022-11-09