GNS3 is a popular tool for completing networking labs and is widely used by many CCNA candidates as an alternative to Cisco’s Packet Tracer and VIRL products. It uses
qemu to create a realistic virtual networking environment largely identical to Cisco’s VIRL. This post logs the steps involved in getting GNS3 running on CentOS (version 7.5 in my case).
GNS3 on Linux can be installed either using a traditional package manager, or by simply downloading a VM appliance. The appliance didn’t work for me in KVM, it booted (?) then simply froze. So I went the traditional package way.
First up, GNS3 for Linux is developed primarily for Ubuntu, and by extension Debian. So the best approach is to run up an Ubuntu or Debian VM in KVM, then install GNS3 onto that. I downloaded the latest net install image from the Debian download page (debian-9.4.0-amd64-netinst.iso) and did a basic installation with the LXDE desktop. On a laptop running CentOS 7.5 with 8GB RAM and an Intel Core i7 processor, I gave the Debian VM 4GB RAM and 2 virtual cores.
All the following steps require root privileges. Note that by default Debian appears to use
su to gain root privileges (like CentOS), not
sudo (like Ubuntu). Once logged in as root, the first thing to do is to add the GNS3 repos to
/etc/apt/sources.list (the Debian equivalent to adding repo files to the
/etc/yum.repos.d/ direcory on CentOS) as follows:
deb http://ppa.launchpad.net/gns3/ppa/ubuntu xenial main deb-src http://ppa.launchpad.net/gns3/ppa/ubuntu xenial main
Then run the following commands to install certificate management and developer keys, update the repo database, and install GNS3:
apt-get install dirmngr apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F88F6D313016330404F710FC9A2FD067A2E3EF7B apt-get update apt-get install gns3-gui
Next, install the
ubridge package …
apt-get install ubridge
… then add the user you will use to run GNS3 to the
usermod -aG sudo youruser usermod -aG ubridge youruser
The GitHub page for ubridge describes it as a “simple application to create user-land bridges between various technologies”. It supports bridging between UDP tunnels, Ethernet and TAP interfaces, and packet capture.
Some permissions-related questions need to be answered during installation of the
ubridge package. I selected options which did not imply I was going to run GNS3 with root privileges. If you need to reconfigure
ubridge later for any reason:
Finally, add the
xterm terminal program as this is what GNS3 wants to use by default to enable configuration of virtual routers and PCs:
apt-get install xterm
That is it for getting GNS3 installed and running on a VM in KVM on CentOS. A reboot of the VM seems to be required for the
sudo permissions to be properly applied. You should now be able to start building networks in GNS3.