Running GNS3 with Docker (en)
Quickly set up GNS3 for network experiments
Introduction
This tutorial demonstrates how to run GNS3 in a Linux VM environment on an OrbStack-enabled MacBook using Docker and execute a simple topology.
The benefits of this setup are as follows:
- Easy installation.
- Isolation from the system reduces potential issues.
This guide does not cover GNS3 Desktop configuration or packet capture but focuses on testing routing through Alpine Docker containers with routers and switches.
Additionally, this tutorial relies on the following project:
https://github.com/jsimonetti/docker-gns3-server
Setting up an x86 Docker environment on MacBook
Through several tests, I discovered that specific networking functions of the GNS3 server do not work correctly in an ARM64 Docker environment.
To ensure a proper experiment, we will simulate an x86 environment using a virtual machine with Rosetta.
If you are using Windows or an x86-based environment with Docker installed, you can skip this section.
Download the necessary files from https://orbstack.dev/download or install OrbStack with brew install orbstack
.
After installation, launch OrbStack and navigate to the Machines tab.
Create a VM with the following settings: Ubuntu and CPU type: Intel.
Double-click the VM to open its terminal.
Enter the following commands to set up Docker:
Run the commands below to confirm Docker installation:
Running the GNS3 server on Docker
Continuing from the previously configured x86 environment with Docker installed:
Create a folder to store GNS3 data using the following command:
Then run the GNS3 server with the following command:
Access the server via http://ubuntu-gns3.orb.local:3080/ on your MacBook. If not using OrbStack, use http://localhost:3080 or the VM’s IP with port 3080.
*The address may vary if the VM’s name is different. You can verify active addresses at https://orb.local/.
You will now be able to access the web UI.
A simple GNS3 experiment
Within GNS3, we will create two Docker containers, assign IPs, and test communication via a switch.
Click Add blank project
and input any name.
Click the +
button at the top center and select New Template...
.
Click "Next" and search for "alpine" in the filter. From the list, locate the item of Emulator type "Docker" and click the download icon in its Actions column.
Complete the setup by clicking Create docker template
.
Drag two Alpine Linux instances and one Ethernet switch onto the workspace.
Connect them using the line tool next to the +
button.
Right-click each Alpine Linux machine, select Configure
, then click Edit network configuration
. Paste the following content, ensuring the addresses differ for each container:
Click the start button to run the configuration.
Right-click each node and select Web console
to open a terminal for Alpine 1 and Alpine 2.
Ping from Alpine 1 to 192.168.0.2
and from Alpine 2 to 192.168.0.1
to verify communication.
It works! :)
Although GNS3 Desktop and EVE-ng are excellent, this setup is lightweight and sufficient for experimenting with Linux routing tables.