17.9 C
Monday, January 30, 2023

Network Automation Lab on GNS3

If you are new to the world of Network Automation, the first thing you need is to set the virtual lab environment. This step-by-step guide is all about setting up a Network Automation Lab for newbies who want to get their hands dirty with Network Automation Tools.

The main objective of this setup is to connect your home network to the emulator that will be running IOS images of real or virtual routers, switches, and other network devices. Eventually, you will be able to configure the IOS of the real network device from your home network, design a test network, and also run automation scripts on the same devices.

Required Tools for Network Automation Lab

All we need is IOS images of network devices, a virtual machine that runs these IOS (GNS3 VM), an application that allows running virtual machines (VMware), and an emulating software that combines everything to create complex networks (GNS3).

Downloading GNS3 all-in-one tool

The first thing we need is emulating software i.e GNS3. It is an open-source network emulator that allows virtual and real devices to be used to simulate complex networks.

We can download GNS3 for the operating system that is currently running on your PC, I will go for Windows.


Download GNS3 Virtual Machine (VM)

When you install a GNS3 on Windows, then your OS acts as a Local Server but some emulators might not properly work on Windows. This is why, it is recommended with Windows as OS, you also need a Linux Virtual Machine that is running the GNS3 server inside i.e GNS3 VM.

Since I will be using VMware Workstation Pro to run GNS3 Virtual Machine in this article, so I will choose to download VMware Workstation and Fusion. You can download GNS3 VM.


Download VMware Workstation Pro

Finally, download VMware Workstation Pro for the OS of your choice that will be hosting your GNS3 Virtual Machine.


To work everything perfectly, GNS3 and GNS3 VM must have the same software version like in our case, we have the 2.2.12 version for both.


Installation and Configuration

Installing the GNS3 all-in-one tool

Click on the downloaded file to install the same. All we need to do is to keep clicking the Next button and leaving every option to default.


Most importantly, when you reach the step as shown below, leave the checkboxes to default. As we have already downloaded GNS3 VM, we do not need to click the checkbox here to download the same again.


Lastly, click Finish and there GNS3 2.2.12 is at your disposal to play around with.


Running GNS3 for First Time

After finishing the installation process, you can start the GNS3 app. If the app is starting for the first time, you will be prompted for Setup Wizard for basic configuration. Follow the screenshots shown below while setting the options as suggested.

Once the Setup Wizard is finished, you should see the GNS3 App running. On the right side of the screen, you will find the Server Summary that is currently showing that your Local Machine (OS) is working as a Server for GNS3 Appliances. In the later part of the article, we will also configure to run GNS3 VM are server also.


The Green Bubble means that the server is running fine without any issue. But if you see a Red Bubble along, then you might need to restart the GNS3 App, Operating System, or both to change it to green.

Installing the VMware Workstation Pro


Just keep on clicking the Next Button, leaving everything to default, unless you reach the final step as shown below.


When you finish the setup, you will be prompted to restart your PC: click YES to restart.


Configuring Virtual Adapters for VMware Workstation

After finning the installation of the VMware Workstation and restarting the operating system, go to Control Panel > Network and Internet > Network Connections. You should find two newly added Virtual Network Adapters (VMnet1 and VMnet2) by VMware.

If you do not find these virtual adapters for instance, then something might have gone wrong with the installation process.


Right-click both Virtual Adapters one by one and click Properties.


We should make sure that we set to obtain IP and DNS addresses automatically for both Virtual Network Interfaces (VMnet1 and VMNet8) as shown below.

Importing GNS3 VM to VMware Workstation Pro

Now, we will import GNS3 Virtual Machine into VMware Workstation Pro. Before doing that we should have unzipped version of the GNS3 VM.


Open VMware Workstation and go to File>Open, locate the extracted GNS3 VM Appliance, and click open to continue.


You will be prompted to provide the name and storage location of the GNS3 Virtual Application being imported. You can go with the default values but I changed the storage path here.

Now, click the Import button and the appliance will start importing to the VMware.


After finishing the import, you will see the window as shown below that shows the GNS3 VM virtual device details. We will not change any configuration of VM at this stage and will leave everything to default. However, if needed, we can change the RAM and CPU configuration of the VM from the GNS3 tool later.


Click the Play (Power on this virtual machine) button to run the GNS3 VM and you will end up with the screen shown below. The two parameters should have the same value as follows: Virtualization: VMware and KVM Support available: True.


Enabling GNS3 VM from GNS3 Tool

Previously, we had only one default server running on GNS3 App and that is our local machine as shown below. But we want to add another Server to run GNS3 appliances i.e GNS3 VM.

To add/enable GNS3 VM as another server, you will need to enable the GNS3 VM by clicking to Edit>Preference>GNS3 VM as shown below:


The virtualization engine, VM name, and other default settings will be loaded automatically in most cases. But if you do not find anything loaded as shown in the picture above, you can try restarting GNS3, VMware workstation, or PC.

You can also change the size of RAM and the number of CPU cores as per your system configuration.

More the RAM and CPU core, the faster will the GNS3 VM be running.

Finally, you should see two servers running on your GNS3: the default local server, and GNS3 VM as a server.


Adding Virtual Appliances to GNS3

Until now, we have our GNS3 fully loaded to create a complex network but by default, GNS3 has very few virtual appliances. To accomplish the need of setting up Network Automation Lab, we need some advanced network appliances from routers, switches, and other network automation virtual appliances.

We need the following virtual appliances at a minimum to set up a basic lab environment:

Adding Ubuntu Docker Guest Appliance to GNS3

Go to GNS3 Marketplace and download Ubuntu Docker Guest Appliance. You will get a template file with the extension (.gns3a).


Now open GNS3 and click the “New Template” button to import the newly downloaded ubuntu appliance to it.


Now locate the downloaded template file and click the Open button.


Now, keep clicking the Next button throughout the wizard while leaving everything to default. Finally, you will reach the finish screen as shown below.


Now you will have Ubuntu Docker Guest showing in the End Devices section but it is simply a template.


Create a new project on GNS3 and drag and drop the Ubuntu Docker Guest on the screen. For the first time, it will take a few minutes for pulling the image from the template file.

Once the pulling image is completed, your Ubuntu Docker Guest is ready to use in any project.


Adding Network Automation Docker Appliances to GNS3

Go to GNS3 Marketplace and download the Network Automation Docker template file.

Now follow all the steps defined in adding Ubuntu Docker Guest in the previous example and you will end up with Network Automation Docker appliance as shown below.


Adding Cisco7200 Router Appliances to GNS3

Virtual appliances files can have different extension like (.bin, .vmdk, .image, and .qcow2) and each have different methods of installation. In this example, we have an appliance image in (.bin) format which needs to be decompressed first and then used.

Open GNS3 and go to Edit>Preferences>Dynamips>IOS Routers and click New Button.


Choose the option Run this IOS on the GNS3 VM and click the Next button to continue.


Browse the location of the downloaded image file of Cisco7200 on your PC.


Select the image file and click the Open button.


Since the image is a compressed file with (.bin) extension, we will decompress it to the (.image) file extension.


The image file has been decompressed and selected.


Now keep clicking the Next button to continue with the default options.

Finally, the Cisco router appliance has been successfully loaded to GNS3 and is ready to be used as a virtual appliance.


You can drag and drop the Cisco Router c7200 Appliance on the project area and run it.


Now open the router’s console on Solar Putty to see the screen below:


Adding Cisco csr1000v Router Appliance to GNS3

Now in this example, we have (.qcow2) extension of the image, we will a different method for installation.

First of all, you need to copy the (.qcow2) image to the default image folder of the GNS3 App on your PC. In my case, C:\Users\Gulraiz\GNS3\images\IOS is the default location of GNS3 Images – I have copied the image file to this folder.

Now, we need to download the template file of this (.gns3a) image from the GNS3 marketplace. Go to Cisco csr1000v and download the template file.

Now we need to add a new template from GNS3:


Choose the location of the downloaded template file (.gns3a).


Continue with the default settings.


If you have already copied the (.qcow2) image file to the default images folder of GNS3 App (C:\Users\Gulraiz\GNS3\images\IOS), then this step will automatically pick up the file locally and ready to install.


The image file is getting uploaded to GNS3.


After successful installation of the appliance, you can see the Cisco CSR1000v template in your GNS3, which is ready to use by dragging and dropping it in the project area.

You can open its console for the initial configuration as shown below:


After completion of some initial configurations, your CSR1000v Router is ready to be configured.


Adding Other Remaining Appliances

We have already seen different methods of installing virtual appliances to GNS3, you can install the remaining appliances by using one of the methods defined in previous sections.

Connecting GNS3 to Home Network

Adding Virtual Network Interface to GNS3 VM

First of all, we need to add a Virtual Network Bridge Interface to GNS3 VM. Go to Settings of GNS3 VM.


Click the Add button to open Add Hardware Wizard.


Select Network Adapter and click the Finish button.


When you click the Finish button, you will see three Network Adapters: Network Adapter (default), Network Adapter 2 (default), and Network Adapter 3 (new).

Select Network Adapter 3, and click on the Bridged option in Network Connection Section. As a result, we have three Network Adapters, for NAT, Host-only, and Bridged connection types respectively.

Please note that the sequence of Network Interfaces matters for configuration purposes.


Setting up Demo Lab on GNS3

Now we need to set up a demo lab on the GNS3 app to test connectivity between the physical network and GNS3 appliances. In this example, we have a virtual appliance (c7200 Router) and Cloud Appliance which acts as a physical network.


Configuring Cloud

Righ-click the Cloud1 and click configure.

You will find the three interfaces eth0, etho1, and etho2 that represent the three adapters of GNS3 VM Network Adapter (NAT), Network Adapter 2 (Host-only), and Network Adapter 3 (Bridged) respectively.

In this example, we will select the eth2 interface which means bridge connection between physical network and GNS3. Bridged mode replicates another node on the physical network and your VM will receive its own IP address if DHCP is enabled in the network.

If you connect the Physical Network to GNS3 Appliances through Wi-Fi Interface, it may not work properly. It is highly recommended to use Wired Ethernet or Loopback interface only for this purpose.

Configuring Router

Now open the router’s console and configure inter f0/0 to get an IP address through DHCP.

Below are the commands to set interface f0/0 for DHCP.

R1#configure terminal
R1(config)#interface f0/0
R1(config-if)#no shut
R1(config-if)#ip address dhcp
R1(config-if)do show ip interface brief

You can see DHCP has assigned to interface f0/0. The network address is which is the same as Home Network Address.

To verify, open Command Prompt and issue a command “ipconfig“, you can see the network address of the IP address assigned to f0/0 is the same as the Home Network which is

You can see that PING is also successful from my home network to the Router interface.

Configuring SSH on Router

Now let me show you SSH using Putty from Windows.

Please note that you need to do some additional configuration to the router to enable SSH access. The configuration is as follows

Router#configure terminal
Router(config-line)#line vty 0 4
Router(config-line)#login local
Router(config-line)#transport input ssh
Router(config)#username admin privilage 15 password cisco
Router(config)#cyrpto key generate rsa modulus 1024

Opening SSH Session to Router

By using PuTTy client software, you can create SSH Session to access Router CLI from your home network.

Open PuTTy, provide IP Address of Router’s Interface i.e

Click the Open button, you will be prompted to save the Router RSA Key to PuTTy cache. You can click Yes if you do not want this prompt to pop up again when you create a session with the router.

Finally, you have access to Router’s CLI using the PuTTy client.

Troubleshooting GNS3 VM

Sometimes working with GNS3 becomes a matter of great patience when GNS3 VM does not work properly. In this section, we will try to find out possible reasons that may cause GNS3 not to work properly and we will discuss the possible solutions. The most common problem is that GNS3 is not booting up and it is greyed-out as shown below.

Same version of GNS3 and GNS3 VM/Server

There must be the same version of GNS3 and GNS3 VM/Server.

VMware Workstation vs Workstation Player

It is observed that GNS3 sometimes does not properly work with VMplayer. It is recommended to use VMware Workstation Pro to avoid any problem of interfacing GNS3 and GNS3 VM.

VMware Virtual Network Editor

We need to make sure that Virtual Network Interface in VMware is bridged to the correct Network Interface. For example, we can see below that we have a Network Controller name Realtek PCIe GbE Family Controller.

To verify that the correct Network Interface is bridged in VMware, you need to open VMware Workstation and click the Edit > Virtual Network Editor > Change Setting button.

Now select the Bridged Interface and you can see that the bridged interface is the same as Correct Network Interface i.e Realtek PCIe GbE Family Controller.

Toggling Status VMware Virtual Adapters

VMnet1 and VMnet8 are virtual adapters that are installed automatically with VMware Workstation Pro. Sometimes disabling/enabling them fixes the problem of GNS3 VM working properly.

Right-click both interface one by one and disable them. Then enabling them again might resolve the issue.

Antivirus/Firewall Blocking

Make sure that any anti-virus and firewall is not blocking the connection between VMware and GNS3.

Windows Update

If you are using Windows 10/11, make sure it is up to date.

Gulraeez Gulshan
Gulraeez Gulshan
I am an engineer, programmer, tech-savvy professional, and very passionate about the latest technologies for the modern web, mobile, cloud-native, machine learning, and network automation. I have a bachelor's degree in Electronics Engineering and a Master's degree in Computer Science and Information Technology from a renowned university in Pakistan. I have not limited myself to a certain set of skills in this era where technology is in a state of flux; I have experience working with an extensive range of technologies and learning daily to update my skills and adapt to the latest technologies

Related Articles



Please enter your comment!
Please enter your name here

Latest Articles