Simple topology
Basic example of launching a minimal topology with two routers, including a brief breakdown of the process.
We’ll build an OSPF session between two routers. To begin, create a working directory and place a topology.yml file inside it.
---
provider: clab
defaults.device: frr
module: [ ospf ]
nodes: [ r1, r2 ]
links: [ r1, r2, r1-r2 ]The file defines the following:
• Containerlab is used as the orchestration backend
• The device image is FRR
• OSPF is configured as the dynamic routing protocol
• Two routers will be created: r1 and r2
• Three network links will be established - stub link on r1, stub link on r2, p2p between r1-r2
After running netlab up, the following files and directories will be generated:
containerlab configuration file
Device configuration files mapped into FRRouting containers
hosts.yml(Ansible inventory file)host_varsdirectory (Ansible host variables)group_varsdirectory (Ansible group variables)ansible.cfg(Ansible configuration file).
Once the lab is launched, FRR containers will start, followed by device configuration via Ansible using predefined templates.
All required parameters not explicitly defined in the topology file — such as addressing, interface numbering, and others — will be automatically assigned using default values.
Once the lab is up and running, you can connect directly to the devices using netlab connect and interact with them as needed.
When you're done working with the lab, run netlab down to shut down the containers and release the allocated resources. All files generated during the lab setup will remain in the working directory.
By default, Netlab supports only one active lab per host. However, the multilab module allows you to run multiple labs concurrently on the same machine.
Last updated