ContainerLab 〡 Tutorials

How to Run Large Network Labs on GCP with netlab

Milan Zapletal
April 30, 2026

Table Of Contents

Every network engineer hits the same wall eventually. You start with a tidy three-node lab on your laptop, then the design grows: a second region, a route reflector pair, a few VRFs, an EVPN fabric, maybe a firewall. Suddenly the fans are screaming, RAM is exhausted, and the lab takes longer to boot than it does to test.

Buying a dedicated home server solves it for a while — but now you own hardware, you maintain it, and it sits idle most of the week. We wanted a third option: rent the iron only while the lab is running. Spin up a beefy VM in the cloud, deploy the topology, do the work, then tear it all down and pay for the hours you actually used.

That is exactly what Simple Labs does. This post explains why it exists, who it is for, and what it looks like in practice.

What Is Simple Labs?

Simple Labs (slabs on the command line) is a small Python CLI that automates the boring parts of running netlab and Containerlab on Google Cloud. In a single command it:

  • Creates a GCP VM with nested virtualization and IP forwarding enabled.
  • Automatically installs Docker, Containerlab, netlab, Ansible, and Python on first boot.
  • Uploads a netlab topology over SSH and runs netlab up for you.
  • Optionally installs a WireGuard server so you can ping and ssh straight into lab devices from your Mac.
  • Tears everything down cleanly when you are done — stop, suspend, resume, or delete with one command.

There is no web UI, no control plane, and no SaaS account. Just your gcloud credentials, a YAML topology, and the CLI.

A Quick Refresher: netlab and Containerlab

If those two names are new to you, here is the short version: Containerlab orchestrates network operating systems as containers and wires them together into topologies. netlab sits one level higher, turning a compact YAML description of your topology into a fully configured, fully wired lab — handling addressing, protocols, and device config automatically.

Simple Labs does not replace either tool. It gives them a place to run when your laptop can’t.

How It All Fits Together

The architecture is deliberately simple: one GCP VM (Ubuntu 22.04, n1-standard-4 or larger, nested virtualization on) running all the containers, with an optional WireGuard tunnel back to your Mac so you can reach the lab management network directly.

     YOUR MAC                                     GOOGLE CLOUD
 ┌──────────────────┐                            ┌────────────────────────────────────┐
                                                                                   
    slabs CLI       ──── GCP API (HTTPS) ────▶ │  Compute Engine VM (n1-standard-4) │
                                                 Ubuntu 22.04 + nested virt        
    ~/.ssh/         ──── SSH (paramiko) ─────▶ │  netlab → containerlab → docker    │
    simplelabs                                                                     
                                                        clab mgmt bridge           
    WireGuard app   ◀═══ WG tunnel :51820 ═══▶          192.168.121.0/24           
 └──────────────────┘                                     r1  r2  s1  s2            
                                                   (cEOS / Linux containers)         │
                                                 └────────────────────────────────────┘

The four steps that make up every session:

  1. slabs vm create — provisions the VM via the Compute Engine API and runs the startup script that installs all tooling.
  2. slabs lab deploy — uploads a netlab topology YAML over SSH; netlab up renders it into a Containerlab spec and launches the containers.
  3. slabs vpn setup — installs WireGuard on the VM, opens UDP/51820 in the GCP firewall, and hands back a client config for your Mac.
  4. From your Mac you can ping/ssh straight into any lab device on the clab mgmt subnet.

A Typical Session

# 1. Authenticate once
gcloud auth application-default login

# 2. Spin up a lab VM (waits until Docker/Containerlab/netlab are ready)
slabs vm create --name lab-vm --wait-ready

# 3. Deploy a topology
slabs lab deploy --vm lab-vm --topology labs/examples/simple-lab.yml --wait

# 4. (Optional) Set up VPN so you can reach lab devices from your Mac
slabs vpn setup --vm lab-vm --output ~/Downloads/lab-vpn.conf

# 5. Do the work ...

# 6. Clean up — pay only for what you used
slabs vm delete --name lab-vm

That is the whole product.

What Gets Installed on the VM

When you run slabs vm create with the default settings, the startup script installs:

  • Docker — container runtime
  • Containerlab — network lab orchestration
  • Python 3.11 — with pip and virtualenv
  • Ansible — configuration management
  • netlab — topology management and device configuration

Pass --no-tools if you want a bare VM and prefer to manage the toolchain yourself.

Full CLI Reference at a Glance

CommandWhat it does
slabs vm createProvision a new GCP VM with nested virtualization and optional tool install
slabs vm setup-statusCheck whether the startup script finished successfully
slabs vm listList all VMs in the project with status and IPs
slabs vm start / stop / suspend / resume / deleteLifecycle management for existing VMs
slabs lab deployUpload a topology YAML and run netlab up on the VM
slabs lab statusShow running containers and their states
slabs lab stopDestroy containers but keep files on the VM
slabs lab imgloadUpload a Docker image tar.gz and docker load it on the VM
slabs vpn setupInstall WireGuard server, open firewall, return client config
slabs vpn statusShow WireGuard peer / handshake info
slabs vpn get-configRe-download the client config (e.g. after VM IP change)

Honest Trade-offs

Simple Labs makes some opinionated choices that will not suit every reader:

  • GCP only. The VM provisioning code talks to the Compute Engine API directly. There is no AWS or Azure backend. n1/n2 instances expose nested virtualization cleanly, and per-second billing is friendly to short lab sessions.
  • You pay the cloud bill. A n1-standard-4 running a medium EVPN fabric is cheap by enterprise standards, but it is not free. If your labs are small enough to live on a laptop, keep them there.
  • You bring the images. Licensed NOSes such as Arista cEOS still need to come from your own vendor account. slabs lab imgload uploads them, but cannot conjure them into existence.
  • It assumes you already know netlab or Containerlab. This is plumbing, not a tutorial.

If those trade-offs are deal-breakers, a homelab or a tool like GNS3 or EVE-NG may be a better fit.

Why PyPI?

The first internal version of Simple Labs was a folder of shell scripts and a Makefile. It worked, but every engineer had to clone the repo, track which branch was current, and keep their local tweaks out of git. “Which script did you run?” is not a great question to answer at 11 pm when a lab refuses to come up.

Shipping slabs as a PyPI package fixed all three pain points at once: one install command that is the same on every laptop, semantic versions with a proper CHANGELOG, and a clean dependency boundary managed by uv. Network automation is overwhelmingly Python — meeting engineers where they already are mattered more than any clever alternative.

Installation

# Recommended (uv)
uv tool install slabs

# Alternative (pipx)
pipx install slabs

# Verify
slabs --help

Requires Python 3.11+ and a GCP project with the Compute Engine API and billing enabled.

Requirements

  • Python 3.11 or later
  • uv package manager (recommended) or pipx
  • GCP project with Compute Engine API enabled, billing enabled, and sufficient quota for n1 machine types
  • gcloud CLI authenticated (gcloud auth application-default login)

Where to Go Next

If you try it and something breaks, open an issue on GitLab. Simple Labs is small on purpose — the best feedback at this stage is a real lab that refuses to boot.

NETWORK AUTOMATION INSIGHTS
Stay informed about the latest in network automation:
Technical deep dives - Implementation guides -
Industry best practices
Netodata official logo featuring a stylized green geometric icon and the brand name "NETODATA" in white and green typography on a transparent background.
From initial consulting to seamless implementation, we manage your network automation journey every step of the way. Our comprehensive suite of professional services caters to diverse enterprises, ranging from startups to established players.
Contact
1-234-1234
info@netodata.io
Address
Nové sady 988/2
602 00, Brno
Czech Republic
ICO: 23213035
GET IN TOUCH
Address
Netodata Labs, s.r.o. © 2026 All Rights Reserved
Nautobot icon

Nautobot

The central Source of Truth for network infrastructure data. Nautobot serves as:
Authoritative inventory database
IP address components tracking
Configuration template repository
Automation platform

Nornir

A Python automation framework specifically designed for network automation. Nornir provides:
High-performance concurrent task execution
Deep Python integration
Flexible inventory management
Fine-grained control over network operations
CI/CD

Orchestration & CD/CI

We integrate industry-standard orchestration tools to ensure reliable automation delivery:
Git-based version control
Automated pipelines
Controlled deployment workflows
Continuous integration practices

Ansible

An industry-standard automation platform that excels at network configuration management. We utilize Ansible for:
Network device configuration deployment
State validation and compliance checking
Integration with custom Python modules
Standardized workflow automation

Netbox

The central Source of Truth for network infrastructure data. NetBox serves as:
Authoritative inventory database
IP address components tracking
Configuration template repository
REST API provider for automation workflows

Python

The foundation of our automation framework, Python enables us to create modular, maintainable, and efficient network automation solutions. We leverage Python's extensive standard library and carefully selected packages to build:
Reusable automation components
Custom network management tools
API integrations
Data processing pipelines