SQUAB is an experiment tool to set up networks by BGP easily on Docker platform.
SQUAB works on macOS 11.6, Docker Desktop 4.2.0, Compose V2 enabled, Python 3.9.8.
The main component is composed of UNIX shell script, Python3, and Docker, so SQUAB probably runs on major UNIX-based OS.
Setting up Docker and Python3 environment on your computer.
SQUAB uses pyyaml, so you should install pyyaml(for example $ pip install pyyaml
).
Building container images.
$ docker build -t quagga -f Quaggafile .
$ docker build -t srx -f SRxfile .
(You must define image names "quagga" and "srx"! If you define other name, it won't execute correctly.)
$ python squab_init.py [config file name]
SQUAB configuration filename extension must ".yml" or ".yaml". The place is "don't care". Sample SQUAB configuration files exist in config directory. Filename removed extension is used as project name.(filename: example.yml -> project name: example)
$ ./squab_pr_list.sh
If you want to get all routers on a project, you can use this script.
$ ./get_all_routing_table.sh [project name]
Each router is composed by container, so you can use docker command for each.
$ ./get_all_tcpdump.sh [project name]
$ ./squab_rm.sh [project name]
RIPEstat BGPlay provides AS path information. You can download the data using the API.
For example)
$ wget "https://stat.ripe.net/data/bgplay/data.json?resource=[AS number]"
SQUAB provides translation script from the data to SQUAB config file.
$ cat [BGPlay JSON file] | ./ripe_tosquab.sh
Generating zebra.conf and bgpd.conf in quagga container image.
Generating zebra.conf, bgpd.conf and srx_server.conf in srx container image.
Generating key and the certificate in srx container image.
When building srx image, it downloads BGP-SRx source and build them.
Setting tcpdump
process (listening to TCP/179 port) for all NIC of container.
The capture data is written in /home/bgp_tcpdump_eth[0-9][0-9]*
.