Lately, I’ve been switching from my Windows laptop to MacBook M2 for daily driver. It was smooth until I needed to migrate my virtual networking lab that relies on GNS3. It’s for my preparation before taking another Mikrotik’s certification. I was initially hesitant about whether I could run GNS3 on my M2 machine. After some research, I discovered that the GNS3 client is indeed available for macOS. To host the GNS3 server, I learned that I could set it up from scratch on a Linux machine using Orbstack.

Goals

  • Get GNS3 server running on M2 Apple Silicon CPU.
  • Get GNS3 appliance installed on the GNS3 server.

Prerequisites

Diagram

I drew a diagram to give you an overview of what we are going to do here.

image-20250129212031966

On Mac

Deploy A Linux Machine

With Orbstack, create a new Linux machine with the latest Ubuntu distro.

$ orb create --arch amd64 ubuntu gns3-host

Then verify the machine is running.

$ orb list
NAME       STATE    DISTRO  VERSION   ARCH
----       -----    ------  -------   ----
gns3-host  running  ubuntu  oracular  amd64

The Linux machine we just installed will act as the GNS3 server host.

Resources Allocation

We can allocate CPU and memory resources to limit how much Orbstack machine can use with:

#Show current configuration
$ orb config show

#Set maximum CPU cores for Orbstack to 4 cores
$ orb config set cpu 4

#Set maximum memory for Orbstack to 8 GB
$ orb config set memory_mib 8000

On the Linux machine

Hosting GNS3 Server

From Mac, login into the machine.

$ orb -m gns3-host -u root

Add the GNS3 repository and install some necessary tools.

user@gns3 $ sudo add-apt-repository ppa:gns3/ppa
user@gns3 $ sudo apt update
user@gns3 $ sudo apt install software-properties-common
user@gns3 $ sudo apt install qemu-system-x86
user@gns3 $ sudo apt install telnet
user@gns3 $ sudo apt install gns3-server

In the middle way, select “yes” when you prompted with something like this.

image-20250129214423431

If you missed the prompt, run the following.

#Add ubridge group to the gns3 user
user@gns3 $ sudo usermod -aG ubridge gns3

Verify the GNS3 server installation.

user@gns3 $ systemctl status gns3-server

Or by visiting “http://localhost:3080”.

Change Working Directory

This is optional. I would like to move the default working directory of GNS3 at /var/lib/gns3-server/GNS3/ to /opt/gns3/.

#Create new dir config
user@gns3 $ sudo mkdir /opt/gns3

#Copy old dir config to new dir config
user@gns3 $ sudo cp -r /var/lib/gns3-server/GNS3/* /opt/gns3

#Change ownership 
user@gns3 $ sudo chown -R gns3:gns3 /opt/gns3

#Change default home directory
user@gns3 $ sudo usermod -d /opt/gns3 gns3

Configure GNS3 Server

Since KVM is not supported inside the orbstack machine, we need to make some adjustments for GNS3 server config. Edit the config at /opt/gns3/.config/GNS3/2.2/gns3_server.conf as follows:

[Server]
host = 0.0.0.0
port = 3080
images_path = /opt/gns3/images
appliances_path = /opt/gns3/appliances
configs_path = /opt/gns3/configs
projects_path = /opt/gns3/projects
symbols_path = /opt/gns3/symbols

report_errors = True

; First console port of the range allocated to devices
console_start_port_range = 5000
; Last console port of the range allocated to devices
console_end_port_range = 10000

; First VNC console port of the range allocated to devices.
; The value MUST BE >= 5900 and <= 65535
vnc_console_start_port_range = 5900
; Last VNC console port of the range allocated to devices
; The value MUST BE >= 5900 and <= 65535
vnc_console_end_port_range = 10000

; First port of the range allocated for inter-device communication. Two ports are allocated per link.
udp_start_port_range = 10000
; Last port of the range allocated for inter-device communication. Two ports are allocated per link
udp_end_port_range = 20000

; Only allow these interfaces to be used by GNS3, for the Cloud node for example (Linux/OSX only)
; Do not forget to allow virbr0 in order for the NAT node to work
allowed_interfaces = virbr0

; Enable the built-in templates
enable_builtin_templates = True

; check if hardware virtualization is used by other emulators (KVM, VMware or VirtualBox)
hardware_virtualization_check = False

[Dynamips]
allocate_aux_console_ports = False
mmap_support = True
sparse_memory_support = True
ghost_ios_support = True

[IOU]
iourc_path = /opt/gns3/iourc
license_check = True

[Qemu]
enable_kvm = False
require_kvm = False
enable_hardware_acceleration = False
require_hardware_acceleration = False

If the config directory don’t exist do the following (inside the orbstack VM):

  1. Run systemctl stop gns3-server.
  2. Run gns3server manually for a minute and stop it.
  3. Start again with systemctl start gns3-server.
  4. Look up again under /var/lib/gns3-server/GNS3/.config or /opt/gns3/.config if you follow the step 3.

We’re done with the server here.

Setting Up GNS3 Client

GNS3 Client

GNS3 Client should detect the server automatically, if not, try open the GNS3 Client > Settings > Server and point the GNS3 server to the Linux machine.

image-20250129223723294

Verify the connection.

Appliances Installation

The network appliances now can be installed normally.

The results

Testing Initial Setup

So far, excluding the ATM and Frame relay switches, I’ve tested the basic appliances and everything works as it should except for the Cloud appliance.

image-20250129230112734

Performances

I allocated 4 CPUs and 4 GB of memory to Orbstack for the initial lab setup. Despite adding two more routers, everything runs smoothly and fast, with no choppy performance at all.

image-20250130222443482

Conclusion

At this point, GNS3 hosted within Orbstack Linux machine ran seamlessly on my M2 Mac. This should be enough for creating or simulating networking projects. However, I still wanted my network appliances could communicate with the LAN on my Mac, which I will dig into it in the next section.

Dig into Network Limitation

Accessing GNS3 Appliances from Mac LAN

According to the documentation, all Orbstack Linux machines are connected to the same network bridge with a fixed IPv4 address of 198.19.249.0/24. On Mac, this network bridge displayed as bridge100 and the Linux machines connected to that bridge via its eth0.

My goal is, let’s say Winbox on Mac, will able to communicate with the GNS3 Mikrotik through the Cloud appliance via eth0 of GNS3 server. Here’s the diagram.

image-20250201125922492

Unfortunately, the Cloud appliance here did not list the eth0 interface.

image-20250130225807891

In the image above, virbr0 and gns3tap0-0 are the interfaces that GNS3 use for the NAT appliances (source). When I ran the script that populates the interfaces on the GNS3 server manually, the output states that eth0 cannot be used on this server.

image-20250131005043784

After taking another look at the code, I figured out where the issue was. You guys probably have noticed it. 😂

...

if not sys.platform.startswith("win"):
        allowed_interfaces = Config.instance().get_section_config("Server").get("allowed_interfaces", None)
        if allowed_interfaces:
            allowed_interfaces = allowed_interfaces.split(',')
        net_if_addrs = psutil.net_if_addrs()
        for interface in sorted(net_if_addrs.keys()):
            if allowed_interfaces and interface not in allowed_interfaces and not interface.startswith("gns3tap"):
                log.warning("Interface '{}' is not allowed to be used on this server".format(interface))
                continue
...

Yeah, it’s on the step 3, about the server config! I just need to add the interface I want to be allowed there. Haha.

; Only allow these interfaces to be used by GNS3, for the Cloud node for example (Linux/OSX only)
; Do not forget to allow virbr0 in order for the NAT node to work
allowed_interfaces = virbr0,eth0 
; ^ I added eth0

After that, pinging from Mac to GNS3 Mikrotik is reachable, but it’s not over yet!

image-20250201140538579

I’m still unable to access the services like for example Mikrotik Winbox on port 8291 or WebFig on port 80. It results the same with the GNS3 server.

image-20250202135153641

Inspecting the traffic with Wireshark, I saw that no TCP handshake was performed. I gave up! Orbstack network implementation is beyond my understanding, so I don’t know what exactly it does under the hood.

image-20250201163513432

It seems I have to wait for Orbstack to fully support bridged networking. In the meantime, I will take a look for other options like UTM, or even move to PNET Lab. Personally, I liked Orbstack more, it almost similar to WSL but on Mac.

That’s all, see you in the next post!

References