Explore Configurations of Unfamiliar Devices with netlab

Apart from IP multicast and QoS, netlab can configure commonly used networking technologies across dozens of devices from most networking vendors. Why don’t you use all that embedded knowledge (supported by hundreds of integration tests) to help you configure unfamiliar devices?

You don’t have to install VM or container managers (Vagrant/containerlab), or beg vendors to give you access to device VMs/containers, to get working device configurations. All you need is a Python package that works on Windows1, macOS, or Linux.

It’s as simple as this:

  • Install networklab Python package. As we’re dealing with a one-off test, use a virtual environment:
$ python3 -m venv nlt
$ source ./nlt/bin/activate
$ pip3 install networklab

If you feel adventurous and don’t mind running a script downloaded from a random website through sh, use the phenomenal uvx.sh service to install netlab (visit uvx.sh to find out the corresponding Windows command):

$ curl -LsSf uvx.sh/networklab/install.sh | sh

Compared to what we had to deal with, UVX is condensed PFM.

$ netlab create -d iol -p clab -o config https://github.com/bgplab/evpn/blob/main/evpn/1-bridging/solution.yml
  • Treat the downloaded lab topology as a scratchpad and adjust it to your needs.
  • Some topologies have hard-coded devices. Edit them and remove all mentions of device attributes
  • Integration tests often include validation part or extra plugins that help make tests work (with warnings) across semi-supported devices. Edit that out.
  • Retry as often as needed ;), replacing the URL with downloaded.yml (the name of the downloaded topology file).
  • Explore the node_files directory. It has a separate subdirectory for each node in the lab topology; each subdirectory contains a file for every configuration module (technology) used on the node. For example, these are the files we’d get for the S1 switch running Cisco IOL:
$ ls node_files/s1
bgp     evpn    ifstate initial ospf    vlan    vxlan

Here’s a sample Cisco IOL VLAN and VXLAN configuration:

!
bridge-domain 100
 member Ethernet0/2 service-instance 100
!
interface Ethernet0/2
 service instance 100 ethernet
  encapsulation untagged
interface nve1
 no shutdown
 source-interface Loopback0
 host-reachability protocol bgp
 member vni 100100 ingress-replication

And here’s the EVPN part (it has an extra route-map that is used only on EBGP sessions):

! 
bridge-domain 100
 member evpn-instance 100 vni 100100
!
l2vpn evpn instance 100 vlan-based
 encapsulation vxlan
 replication-type ingress
 rd 10.0.0.1:100
 route-target import 65000:100
 route-target export 65000:100
!
route-map evpn_nh_unchanged permit 10
 set ip next-hop unchanged
!
router bgp 65000
 address-family l2vpn evpn
  neighbor 10.0.0.2 activate
  neighbor 10.0.0.2 send-community both

Obviously, you could also ask your favorite AI buddy to create the device configs directly ;)


  1. I know of people using netlab on Windows Subsystem for Linux. As we’ll be using only Python functionality, everything should also work on Windows. ↩︎

  2. Some labs include solution.yml topology. ↩︎

  3. It works better if you include pointers to https://netlab.tools/ and https://github.com/ipspace/netlab-examples in the prompt. ↩︎

Add comment
Sidebar