This repository deploys a small campus routing lab with Containerlab.
R1 is the campus edge. R1, R2, and R3 form the OSPF campus core. R1 also has external BGP sessions with ISP and REN. H1 through H4 receive addresses through DHCP; H1/H2 share R2's LAN, and H3/H4 share R3's LAN.
The lab demonstrates:
- OSPF routing and convergence in the campus core.
- External BGP sessions with a commercial ISP and a non-commercial REN.
- Standard BGP communities emitted by the external speakers and interpreted by R1 for local preference.
- Conditional propagation of an ISP-gated default into OSPF.
- Endpoint traffic during normal and failed-link conditions.
The generated BGP prefixes are control-plane test routes. There is no host or service behind these prefixes, and R1 does not redistribute them into OSPF. Instead, R1 originates an OSPF default while its ISP BGP session is established. REN availability alone does not qualify the default, and the default does not provide Internet forwarding through the ExaBGP speakers.
- An x86_64 Linux host with Docker and Containerlab.
- KVM access through
/dev/kvmis recommended for the three RouterOS nodes, but the topology includes a QEMU TCG fallback so it can run on macOS and other hosts without KVM. - GNU Make, GNU coreutils (
sha256sum), Bash, Git, curl, patch, unzip, Python 3.10 or newer,pexpect, and an OpenSSH client.
The lab uses the pinned RouterOS image
vrnetlab/mikrotik_routeros:7.21.5. The Makefile can build this image from
the official MikroTik CHR download.
Run these commands from the repository root:
make deploy
make validate
make destroyThe first make deploy:
- Creates the host OVS bridges if they are missing.
- Generates the BGP advertisements and RouterOS startup files.
- Builds the RouterOS image if it is not present.
- Builds the endpoint and ExaBGP images.
- Deploys or replaces the Containerlab lab.
make destroy removes the host bridges created by make deploy when they
have no remaining ports. It leaves pre-existing bridges and bridges with
remaining ports in place.
The RouterOS image build checks out a pinned vrnetlab commit, locks its base
image and Debian packages, and verifies the official RouterOS 7.21.5 CHR
archive before extraction. Use
make routeros-image if you want to run this build separately. See
Build the RouterOS image for details and manual
instructions.
RouterOS uses the lab-only credential admin / admin. Do not expose this
lab to an untrusted network.
Send continuous ICMP traffic from H1 to H2:
make trafficSelect any two different endpoints, for example H1 to H3:
make traffic TRAFFIC_SOURCE=H1 TRAFFIC_DESTINATION=H3Trace routes between endpoint hosts, routers, and external speakers with:
make traceroute H1 ISP
make traceroute H1 R1Press Ctrl-C to stop the traffic.
Show, disable, and restore one lab link:
make link status r2 r3
make link down r2 r3
make link up r2 r3Link endpoints can be given in either order. For the external links, use
r1 isp or r1 ren. A link that you disable stays disabled until you restore
it or destroy the lab.
Inspect, release, and renew DHCP on an endpoint host:
make dhcp-status H1
make dhcp-release H1
make dhcp-renew H1The supported endpoint hosts are H1, H2, H3, and H4. Releasing a lease does not stop the endpoint container.
Run the automated failure and recovery tests:
make failure-testsSee Operate the lab for traffic options, all link commands, validation modes, and failure-test behavior.
- RouterOS image build
- Lab operations
- Address and route-generation reference
- Test structure
- Contribution guide
- Campus routing lab language
- Architecture decisions
Run make help to list the main operator and development commands.
This project is available under the MIT License.