GNS3 Network Simulator on Google Cloud Platform (GCP) in 10 Minutes

Ronnie Smith
3 min readSep 7, 2024

--

This article steps you through the installation of the GNS3 network simulation system consisting of two components, the graphical user interface (GUI) program and the GNS3 server. GNS3 documentation recommends the server be a virtual machine so that’s what we are building out on GCP.

Installing the Server

To begin, you will need a GCP account with billing enabled. The GCP Console (admin website) is located at console.cloud.google.com.

Configure GCP’s Firewall

The GNS3 GUI program running on your computer talks to the server via a few TCP ports which are denied by default. From the GCP console main menu (top left) > VPC Network then click Firewall. Click Create firewall rule. Name the rule gns3. Add gns3 in the Target tags field. Enter 0.0.0.0/0 in the Source IP range field. Click TCP and add tcp:23, 80, 443, 3080, 5000–5010 .

Create GCP Virtual Machine Instance

From the GCP console main menu (top left), click Compute Engine then VM Instances. Click Create Instance.

Note: You can’t use VMs powered by AMD and Arm processors. For VMs powered by Intel processors, you can’t use any of the memory-optimized, the E2 general-purpose, or the A3 accelerator-optimized machine types. (source: About Nested Virtualization).

Choose the N1 (or N2 or N4 if you need more horsepower) Series in the Machine configuration section. Click Change under Boot disk and set the Operating system to Ubuntu and the Boot disk type to Standard persistent disk. Finally, in the Advanced Options section, under Networking, add a network tag gns3.

Click Create. Do not start the VM.

Enable Nested Virtualization

Enabling nested virtualization on the GCP virtual machine instance requires a couple of commands in the Cloud Shell terminal. Open the Cloud Shell Terminal and export the previously created N1 series instance configuration file. Rename the placeholders VM_NAME and ZONE in the command below with your values:

gcloud compute instances export VM_NAME \
--destination=build.yaml \
--zone=ZONE

Now open the Cloud Shell Editor to edit the configuration file. Prepend the following lines to the beginning of the file and close the file to save it. Careful not to add any spaces before existing text.

advancedMachineFeatures:
enableNestedVirtualization: true

Finally return to the Cloud Shell Terminal to update the instance. Replace placeholder values VM_NAME and ZONE with your own:

gcloud compute instances update-from-file VM_NAME \
--source=build.yaml \
--most-disruptive-allowed-action=RESTART \
--zone=ZONE

Start the server.

Install GNS3 Remote Server Software

Access the terminal of the previously started GCP virtual machine instance by clicking the SSH button from the VM instances page on the GCP Console. Enter the following command to verify that nested virtualization has been enabled. Any value returned other than 0 verifies that nested virtualization has been enabled. If nested virtualization is not enabled go back and enable it now.

grep -cw vmx /proc/cpuinfo

Enter the commands below to install the GNS3 server software on the GCP virtual machine instance.

cd /tmp
curl https://raw.githubusercontent.com/GNS3/gns3-server/master/scripts/remote-install.sh > gns3-remote-install.sh
sudo bash gns3-remote-install.sh

The shell script will take a couple of minutes to finish. Move on to the next section Install the GUI and check back here after that. Reboot the server after the remote server installation is complete.

Install the GUI

Download the Windows, Mac, or Linux software directly from GNS3’s website (software download). Follow the installation prompts to install the GUI program on your computer.

Launch the GUI program. Click Edit > Preferences. In the Server section, enter the public IP address of the GCP VM instance in the server host field. No authentication. Click Apply OK.

Using the System

You now have a working GNS3 system! Get here in 10 minutes? Let me know! Turn the GCP virtual machine server instance off when you are not using it to save money. To get started with your first network simulation, see the Getting Started documentation at gns3.com.

--

--

Ronnie Smith

Delivering refined solutions via vigorous practice. Tulane ('97), Cisco CCIE# 6824, Google Certified Professional Cloud Architect, and USPA Master Skydiver