GNS3is a popular tool to learn and test networking implementation. It allows the simulation of complex networks. You can easily learn how to install GNS3 on Kali Linux to prepare for networking certifications such as CCNA and CCIE.
Graphical Network Simulator is used to simulate virtual networks with computers, switches, routers, and firewalls. It allows users to build their virtual topology which can be tested and implemented. GNS3 can support many vendors including CISCO switches, Brocade Routers, Docker instances, and Linux appliances.
GNS3 is not only open-source and easily available, but it also supports an unlimited number of devices. Also, it supports all Cisco Virtual Internet Routing Lab (VIRL) images, multiple switching options, and both paid and free hypervisors. Lastly, it has native support for Linux operating systems, independent of any virtualization software.
This article will cover how to install GNS3 on Kali Linux. We will also learn how to create a sample network using the GNS3 client.
1. Update the Kali Linux System
The first step is to update your Kali Linux system to update all packages. Use the
apt update command for this step.
sudo apt update
This is what your output would look like when the system is updating:
For a detailed guide on updating Kali Linux systems, check out this article.
2. Install dirmngr Package on Kali Linux
The next step is to install the
dirmngr package. The
dirmngr package is a server for downloading and managing OpenPGP and x.509 certificates. OpenPGP and x.509 are encryption standards. To install
dirmngr, execute the following command:
sudo apt install dirmngr
You will get a similar output:
3. Install Dependencies
Execute the following command to install the dependencies required for installing the GNS3 Server and Client.
sudo apt install -y python3-pip python3-pyqt5 python3-pyqt5.qtsvg python3-pyqt5.qtwebsockets qemu qemu-kvm qemu-utils libvirt-clients libvirt-daemon-system virtinst wireshark xtightvncviewer apt-transport-https ca-certificates curl gnupg2 software-properties-common
You will get a similar output as the required dependencies are installed on your system:
It will take some time for the package installation, so wait for it to finish first before moving on to the next step.
Also, there are different methods of installing GN3 on Debian-based distributions. Since Kali is based on Debian Buster, we will follow the method required for this distribution. For more details, check out the official GNS3 documentation.
4. Install GNS3 Server and GUI on Kali Linux
After the required dependencies are installed, we will now install the GNS3 server and its GUI. For this step, use the pip package manager to install the server and GUI for this step. We have already installed the pip3 package manager in step 3.
sudo pip3 install gns3-server sudo pip3 install gns3-gui
You will get a similar output when the installation is taking place:
5. Refresh Metadata and Reboot the System
Now that the installations are done, we will refresh the metadata using the
sudo apt update
It will look something like this:
After that, reboot the Kali system using the reboot command. For example:
6. Open GNS GUI on Kali Linux
Now that GNS3 is installed, open GNS3 from the Start menu as shown below:
Alternatively, you can also open it from the Command-line Terminal. For example:
When you open the GNS3 GUI for the first time, it will ask for some configurations as shown below.
After that, press the Next button and leave the settings as default. The main GUI would look something like this:
Now that it is working, we will set up our network topology.
7. Change Default Project Directory
Before starting with your topology, we will first configure the GNS3 default directory. The default directory from GNS3 is
~/GNS3/ in the user’s HOME directory. We will change this. Create a new directory called GNS3 using the
Secondly, create four more directories using the
mkdir command, and rename them as
After that, open GNS3 GUI and navigate to the EDIT menu from the menu bar. Next, go to Preferences, and under the General Preferences section, choose your directory in the local paths as shown below.
Hit “Enter key”. This will change the default directories for GNS3. Now, you can move on to the next step.
8. Setup Network Topology Using GNS3 GUI on Kali Linux
To set up your own topology, navigate to the File menu and click on “New blank project”. Alternatively, you can press “Ctrl + N” to create a new project.
Give a suitable name to your project and press “OK”.
Secondly, to create a new topology, click on the “Browse End Devices” from the Devices Toolbar.
Now choose the “Ethernet Switch” from the Devices toolbar. If you click on it once, a switch will appear in the workspace.
If you get an error regarding Dynamips missing package, you will have to install it. Navigate to the command prompt and type the following command to install the missing package:
sudo apt install dynamips
Your output will look something like this:
Now reboot your system using the reboot command to implement the changes.
After that, open GNS3 GUI again and start setting up your topology.
From the End devices option, drag and drop a PC from the VPCS option. You will see that a PC, named PC-1, appears beside the switch, Switch1. Drag one more PC from VPCS, and it will appear as PC-2 on the Workspace.
From the Topology console, you can see that three devices are running. You can also check their IP address in the console, as shown in the screenshot given below:
Next, click on the Add Link option from the toolbar. This will change your mouse cursor, indicating you want to create a link.
Click on PC-1. You will see an Ethernet0 option. Click on that and then click on the Switch. A menu of ethernet switches will appear. Choose Ethernet0 from the Switch as well. Repeat the same process with PC-1, but this time, choose the Ethernet1 option in the Switch. Here is what the connection will look like:
The red buttons on the PC indicate that the devices are switched off, and there is no connection.
To fix this, click on the Green Play button, and your devices will start working. Next, click on the Console to power on the connection.
A console window will appear. Here, we will assign some IP Addresses to both the systems using the IP command.
PC-1> ip 10.1.1.1 255.255.255.0 PC-2> ip 10.1.1.2 255.255.255.0
After that, we will try pinging PC-2 from PC-1.
PC-1> ping 10.1.1.2
As you can see, the pinging was successful.
Finally, you have created your first topology. Now, you can add more PCs and switches to extend your network further.
In conclusion, this article has covered how to install GNS3 on Kali Linux. You have also learned how to use GNS3 GUI to create virtual network topologies and design network simulations. We hope you found this article to be helpful.
If this guide helped you, please share it.