Netlab + Codespaces for NetDevOps

I recently did a presentation for Network User Group (PA-NUG) and I shared something Ive recently used Netlab hosted on Codespaces to do some testing and validation of Network Configuration. The video is a short demonstration of how I used it to launch a network lab in codespace and run some netlab validation tests for BGP

Netlab

To be honest , for building labs sucks . If you wanna quickly and cheaply build out multiple node network topology you can follow my quick Deployment section and be running in 10 minutes with Infrastructure as code (IaC). For more details checkout Ivan page – https://netlab.tools/

Key Take Aways with Netlab

  • Describe high level topology in a YAML format without specific implementation details
  • configure Ip Addressing Schema , routing protocols , VLANS and VRF
  • Be up and running with a CLI network topology in minutes

Deployment

  • Ubuntu 20.04 in any cloud or vm
Installation 
sudo apt-get update && sudo apt-get install -y python3-pip
python3 -m pip install networklab
netlab install -y ubuntu ansible libvirt containerlab

Getting Started 
netlab show images
mkdir lab
touch lab/topology.yml 



netlab up
netlab connect r1
netlab connect <string>
vtysh 
netlab status
netlab restart 
cat /etc/frr/daemons 

Netlab Examples

If you want to change the provisioning- or device configuration templates, you can:

Topology

Top Level ElementdescriptionLinks
default
addressing
NodesLab Devices can be a stringhttps://netlab.tools/nodes/
groupsInventory Groupshttps://netlab.tools/groups/
linksdefine connections between nodes(https://netlab.tools/links/)
modulebgp , ospf , etchttps://netlab.tools/modules/
nameoptional used to name linux bridges for vagrant
providerlibvirt , virtualbox , clab , externalphysical hardware can be used
toolsThird Party toolshttps://netlab.tools/extools/

See Addressing Plan

`netlab create -o yaml:addressing`

Monitoring Development Terraform dev

Creating a Graph

pip3 install graphviz
netlab create -o graph:bgp
dot graph.dot -T png -o netsim-graph-bgp.png