GNS3 (Graphical Network Simulator 3) is a popular network simulation software used to simulate complex networks. It allows you to design and test network topologies without needing physical hardware. In this comprehensive guide, we will cover how to install GNS3 on Linux and set up a basic network topology for testing.

Overview of GNS3

Some key things to know about GNS3:

  • Open source network simulation software that runs on Linux, Windows and macOS
  • Uses Dynamips to emulate Cisco IOS images and QEMU for other software images
  • Allows you to design complex network topologies using both emulated and virtual devices
  • Integrates with virtualization platforms like VMware Workstation and VirtualBox
  • Supports capture/replay of real traffic with PCAP integration
  • Has a GUI for drag-and-drop network design as well as CLI/API access

GNS3 is extremely helpful for network engineers to test configurations and get hands-on practice without access to physical gear. It can simulate routers, switches, firewalls and end hosts running real operating systems. Everything runs locally on the GNS3 server for a portable lab environment.

Now let‘s jump in and install GNS3 on Linux!

Installing GNS3 on Linux

These steps will cover installing GNS3 v2.2 on Debian/Ubuntu. You‘ll need a system with at least 4GB of RAM (8GB recommended).

Add GPG signing key

First we‘ll import the GPG key to verify the integrity of GNS3 packages:

sudo apt install dirmngr
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F88F6D313016330404F710FC9A2FD067A2E3EF7B

Add GNS3 package repository

Next we‘ll add the official GNS3 package repository:

echo "deb http://ppa.launchpad.net/gns3/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/gns3.list
sudo apt update

Install GNS3 packages

Now install the main GUI package along with dependencies:

sudo apt install gns3-gui gns3-server

You will be asked a few questions about non-root user access during the install process – choose the options that make sense for your purposes.

That‘s it for setup, GNS3 is now ready to launch!

Getting Started with GNS3 GUI

To open the GNS3 GUI, search for it in your applications menu or run:

gns3

The first time it launches, you‘ll get a setup wizard asking how you want to run topologies. Choose "Run the topologies on my computer" since we installed the GNS3 server locally.

On the Topology Summary page, you can click to add simulated devices like routers and switches to your toolbox. We won‘t get into that just yet though.

Designing Your First Topology

Let‘s build a very basic network by dragging and dropping nodes:

  1. Add a Cloud node from the End Devices section – this will act as our internet gateway
  2. Add an Ethernet Switch from the Switches section – this will connect everything internally
  3. Add two VPCS nodes from the End Devices section – these are simple Linux PCs that we can configure and test connectivity between

Once you‘ve placed the nodes, click on the Ethernet switch and hover over a port. Then click and drag a connection to the Ethernet interface on PC 1. Repeat this to connect PC 2 to the switch as well. Finally, connect the switch to the Cloud node.

Your topology should look something like this:

gns3-first-topology

Now we‘re ready to power it on and start configuring!

Configuring Network Interfaces

Let‘s configure IP addresses on our VPCS nodes so they can communicate over the network:

  1. Right-click on PC 1 and choose Console. This will open a terminal window connected to the node.

  2. Run ip 192.168.1.10/24 to assign an IP address with netmask /24 (255.255.255.0)

  3. Repeat steps 1 and 2 for PC 2, using IP 192.168.1.20

Now that both PCs have addresses on the 192.168.1.0/24 subnet, they should be able to ping each other.

Let‘s test it:

On PC 1:

ping 192.168.1.20

On PC 2:

ping 192.168.1.10

You should see the ping requests succeeding on both PCs – that means our network links are working!

The Cloud node also acts as a gateway to the internet by default, so you could add public IP addresses to your PCs and test internet connectivity. But we‘ll leave it simple for now.

Start Building!

This was just a quick demo, but now you have the basics to start building and testing your own topologies within GNS3.

  • Try adding actual emulated routers like Cisco or Juniper devices
  • Experiment with adding virtual machines and containers
  • Design complex infrastructure with firewalls, load balancers and servers
  • Break things and try to fix connectivity

The possibilities are endless – have fun with it!

GNS3 CLI Usage and Automation

While the GNS3 GUI is handy for interactive usage, more complex programmatic interaction requires using the GNS3 server API and CLI tools.

Here‘s a quick example of using the gns3cli command to create a project.

First let‘s check the server status:

gns3cli version
Server 2.2.29 running on 127.0.0.1:3080
Client 2.2.29

Now we can create a new project called "test":

gns3cli project create test
Created project test with project id 3785e201-c819-45cb-ab44-22a17a4d8211

This will return the ID of your new project which can be used for further commands like adding nodes.

Many more operations around projects, nodes and Appliance templates can be driven via gns3cli – check out the full documentation for capabilities.

This CLI access combined with remote API access via Python, Go or other languages allows you to automate everything in GNS3. So you can script deploying complex environments instead of clicking around in the GUI.

Wrap Up

That wraps up this guide on using GNS3 network simulator on Linux!

We covered:

  • GNS3 overview and use cases
  • Installation process on Debian/Ubuntu
  • Basic GUI topology design
  • Configuring simulated router nodes
  • GNS3 CLI/API basics

Now you have a powerful network testing toolkit ready roll on your Linux machine. With automation options like gns3cli, you can take your network architectures from concept to simulated prototypes in no time!

Let me know if you have any other questions about using GNS3. And happy building!

Similar Posts