Using Containerlab for Network Testing
Testing network automation against real devices is expensive and slow. Containerlab solves this by running network operating systems as containers. You can spin up a full 2-spine, 4-leaf CLOS fabric with eBGP in under 5 minutes.
The Topology
Define your topology in YAML — nodes, links, and management addresses. Containerlab handles the wiring. Each node runs a real NOS image (Arista cEOS, Nokia SRL, or Juniper cRPD), so your automation code runs against the same CLI and API surface as production.
BGP Configuration
With eBGP unnumbered on all fabric links and a unique ASN per leaf, the fabric converges in seconds. Add BFD for fast failure detection and you have a realistic test environment for any automation workflow.
Integration with CI
The real power is running Containerlab in CI. Push a config change, spin up the lab, apply the change, verify BGP state, tear it down. Every PR gets tested against a real network topology.