Skip to content
LLMNetOpsPublic

About

Reproducible Containerlab campus network testbed with RouterOS, OSPF, eBGP, ExaBGP, DHCP, and failure validation.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

Containerlab campus eBGP testbed

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.

Containerlab campus eBGP topology

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.

Requirements

  • An x86_64 Linux host with Docker and Containerlab.
  • KVM access through /dev/kvm is 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.

Quick start

Run these commands from the repository root:

make deploy
make validate
make destroy

The first make deploy:

  1. Creates the host OVS bridges if they are missing.
  2. Generates the BGP advertisements and RouterOS startup files.
  3. Builds the RouterOS image if it is not present.
  4. Builds the endpoint and ExaBGP images.
  5. 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.

Run experiments

Send continuous ICMP traffic from H1 to H2:

make traffic

Select any two different endpoints, for example H1 to H3:

make traffic TRAFFIC_SOURCE=H1 TRAFFIC_DESTINATION=H3

Trace routes between endpoint hosts, routers, and external speakers with:

make traceroute H1 ISP
make traceroute H1 R1

Press 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 r3

Link 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 H1

The 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-tests

See Operate the lab for traffic options, all link commands, validation modes, and failure-test behavior.

More information

Run make help to list the main operator and development commands.

License

This project is available under the MIT License.

About

Reproducible Containerlab campus network testbed with RouterOS, OSPF, eBGP, ExaBGP, DHCP, and failure validation.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages