GNS3 Network Emulator

From Ever changing code

Install GNS3

This is quick guide how to install GNS3 1.x on Linux Ubuntu.


Install dynamips and GNS3 dependencies
sudo apt-get install libpcap-dev uuid-dev libelf-dev cmake python3-setuptools python3-pyqt4 python3-ws4py\
                     python3-netifaces python3-zmq python3-tornado
Download GNS3 sources

Install Dynamips

unzip Dynamips-*.zip
cd Dynamips-*
mkdir build
cd build
cmake ..
sudo make install

Install GNS3 server and GUI front end

unzip gns3-server-*.zip
unzip gns3-gui-*.zip
cd gns3-server-*
sudo python3 install
cd ../gns3-gui-*
sudo python3 install



Initial configuration

Gns3 > Edit > Preferences > Dynamips

  • Enable ghost IOS support - memory mapping allows loaded images in RAM to be shared between other routers

Gns3 > Edit > Preferences > General > Local paths > My binary images: /home/piotr/GNS3/images

  • Setup default IOS images directory

Gns3 > Edit > Preferences > Dynamips > IOS routers > New

  1. Browse.. for IOS image > Decompress image [Yes] extension will change from .bin to .image
  2. Name it > leave default RAM > add slot cards > add WIC cards > compute 'Idle-PC finder' > Finish
  • Create new devices - router

Hardware emulated by GNS3

Router 3725
  • Fixed ports
    • 2 FastEthernet fixed ports (GT96100-FE)
  • NM slots: 2 (maximum of 32 FastEthernet ports or 8 serial ports)
    • NM-1FE-TX - 1port Fast Ethernet 10/100BaseTX interface
    • NM-16ESW - 16 port Fast Ethernet card (used to create a switch)
    • NM-4T - 4 port synchronous (sync) serial network module, DB-60 ports, provides a data rates: port0 only 8 Mbps, port0&2 4 Mbps each or 2 Mbps on all four ports simultaneously.
  • WIC slots: 3 (maximum of 6 serial ports)
    • WIC-1T - 1-port serial WAN interface card (WIC-1T) Synchronous Data Link Control (SDLC)
    • WIC-2T - 2-port Asynchronous serial ports speeds 600bps-115.2Kbps or in Synchronous mode - 8Mbps per port
Router 7200 - Port Adapters (PA)

Online Insertion and Removal (OIR) is supported, allowing you to replace PAs while the router is running.

  • PA-FE-TX (1 FastEthernet port)
  • PA-2FE-TX (2 FastEthernet ports)
  • PA-4E (4 Ethernet ports)
  • PA-8E (8 Ethernet ports)
  • PA-4T+ (4 serial ports)
  • PA-8T (8 serial ports)
  • PA-A1 (1 ATM port)
  • PA-POS-OC3 (1 Packet-Over-SONET port)
  • PA-GE (1 GigabitEthernet port)

Connect to Router console

GNS3 (dynamips hypervisor) is listening on IP ports starting from 2501. Therefore to emulate AUX serial connection we need to telnet port_number. See an example below:

piotr@piotr-x:~$ telnet 2504
Connected to
Escape character is '^]'.
Connected to Dynamips VM "R3" (ID 3, type c7200) - AUX port
Press ENTER to get the prompt.

Configure VPCS - Virtual PCs

Run vpcs in a terminal, then using 1, 2 ... 10 switch between virtual PCs. Use ? at the end of the command for help.

Configure static IP address/mask in CIDR notation and GW

VPCS[1]> ip 24
Checking for duplicate address...
PC1 : gateway

Show current IP configuration

VPCS[2]> show ip all
NAME   IP/MASK              GATEWAY           MAC                DNS
VPCS1         00:50:79:66:68:00  
VPCS2     00:50:79:66:68:01  
VPCS3             00:50:79:66:68:02  

Show all info including lport (listen on port)

VPCS[2]> show 
NAME   IP/MASK              GATEWAY           MAC                LPORT  RHOST:PORT
VPCS1         00:50:79:66:68:00  20000
VPCS2     00:50:79:66:68:01  20001
VPCS3             00:50:79:66:68:02  20002

VPCS - save and load configuration

Save configuration
VPCS[1]> save vpcs-gns3.conf
Restore configuration
~/VPCS$ vpcs vpcs-gns3.conf

Configure GNS3 - connect to the host network via cloud device

In GNS3 you need to add a Host (cloud group device) to your topology. Then right click to configure. Go to NIO UDP tab. To establish connection with VPCS1 select:

       GNS3            VPCS1
    local port       remote port                    
         |                |
            remote host

Explained from point of view of GNS3 (host device on the topology)

  • Local port: 30000 - gns3's host device listens on UDP 30000 port
  • Remote host: - host operation system where VPCS is installed
  • Remote port: 20000 - VPCS1 is listening on UDP 20000 on the host operation system

GNS3 emulator odds

We need to remember that GNS3 is a graphic interface on top of Dynamips emulating Cisco 7200 hardware. Therefore we need to remember about all odds:

  • there is no emulation of Layer1 therefore a link connection need to be hard coded as AUTO SPEED/AUTO DETECT do not work
  • to create/delete a connection it may require to power off a device


Cannot cloase New Project window in Ubuntu 14.04

wmctrl can close a window based on a substring or exact match of the window title wmctrl -c 'substring' or wmctrl -F -c 'exact match'

sudo apt-get install wmctrl
 wmctrl -l
 0x03000002  0 piotr-x XdndCollectionWindowImp
 0x03000007  0 piotr-x unity-launcher
 0x03000011  0 piotr-x unity-panel
 0x03000016  0 piotr-x unity-panel
 0x0300001b  0 piotr-x unity-dash
 0x0300001c  0 piotr-x Hud
 0x0280000a  0 piotr-x Desktop
 0x03200012  0 piotr-x GNS3
 0x0320001d  0 piotr-x New Project
 0x0320002a  0 piotr-x New Project
 0x03200098  0 piotr-x New Project
 0x0400000b  0 piotr-x piotr@piotr-x: ~
 wmctrl -c 'New'
Cannot find New Project window in Ubuntu multiple screen setup

A: Show all desktops overview and drag the windows in physical view of the main screen. Usually your laptop screen is smaller than an external monitor causing that a part of the screen is only logical and does not have a physical screen size.