Learning computer networking is ten times easier when you can build a topology and ping it yourself. The problem: most students do not own a stack of switches. Mininet fixes that — a free, open-source network emulator that turns one Linux machine into a complete virtual network lab in seconds.
What Mininet is
Mininet creates a realistic virtual network — running the real kernel, switch, and application code — on a single machine, controlled through a CLI and a Python API. It is the go-to tool for learning and researching Software-Defined Networking (SDN) with OpenFlow and P4, released under a permissive BSD license. Each virtual host runs real Linux applications like ping and iperf, so experiments behave like the real thing.
3 ways to install it on Ubuntu
1. Via APT (easiest). One command and you are done:
sudo apt update
sudo apt install -y mininet openvswitch-switch
mn --version
I ran exactly this on Ubuntu 24.04 and got version 2.3.0 straight from the official universe repository. For beginners, this is all you need.
2. From source (latest version). Clone the official repo and run the installer script:
git clone https://github.com/mininet/mininet
cd mininet
git checkout -b mininet-2.3.0 2.3.0
util/install.sh -nfv
This is the method most university SDN lab reports use — you pick the exact version and can enable extra components.
3. Pre-built VM image. The Mininet website offers ready-made VM images for VirtualBox/VMware. Download, import, run — ideal if your main machine runs Windows or macOS.
Your first test: pingall
After installing, verify everything works:
sudo mn --test pingall
This builds a default topology (one switch, two hosts, one controller), pings every host from every other host, then cleans up. A healthy install ends with *** Results: 0% dropped (2/2 received).
Honest note from my own attempt: on my container-based VM the command stalled at *** Adding hosts: because the environment blocks network namespace creation (setns: Operation not permitted) — and every Mininet host is a Linux network namespace. That is an environment limitation, not a Mininet bug; on bare-metal Ubuntu or a normal VirtualBox/VMware VM it runs fine. I also learned that the APT install ships no default OpenFlow controller, so Mininet prints No default OpenFlow controller found and falls back to OVS Bridge — completely normal for basic topologies.
5 commands worth memorizing
-
sudo mn— interactive CLI with the default topology -
pingall— connectivity test between all hosts -
h1 ping -c1 h2— ping from a specific host -
xterm h1 h2— open a terminal on each host -
exitthensudo mn -c— quit and clean up leftover topologies
Try variations like sudo mn --topo single,3 or sudo mn --topo linear,4 once you are comfortable. The full Indonesian walkthrough — including troubleshooting for the errors above — is in the complete Mininet on Ubuntu guide.
Top comments (0)