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 and H2 receive addresses through DHCP.
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 strongly recommended for the three RouterOS nodes. - 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:
- 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.
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 trafficPress Ctrl-C to stop the traffic.
Show, disable, and restore one lab link:
make link-status LINK=r2-r3
make link-down LINK=r2-r3
make link-up LINK=r2-r3Valid link names are r2-r3, isp, and 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 ENDPOINT=H1
make dhcp-release ENDPOINT=H1
make dhcp-renew ENDPOINT=H1The supported endpoint hosts are H1 and H2. 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.