Actions

GNS3 Network Emulator

From Ever changing code

Install GNS3

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

Prerequisites

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
wget https://github.com/GNS3/gns3-gui/releases/download/v1.3.1/GNS3-1.3.1.source.zip
unzip GNS3-1.3.1.source.zip

Install Dynamips

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

Install GNS3 server and GUI front end

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

Run

gns3&

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 127.0.0.1 ports starting from 2501. Therefore to emulate AUX serial connection we need to telnet 127.0.0.1 port_number. See an example below:

piotr@piotr-x:~$ telnet 127.0.0.1 2504
Trying 127.0.0.1...
Connected to 127.0.0.1.
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 10.0.10.10 10.0.10.1 24
Checking for duplicate address...
PC1 : 10.0.10.10 255.255.255.0 gateway 10.0.10.1

Show current IP configuration

VPCS[2]> show ip all
NAME   IP/MASK              GATEWAY           MAC                DNS
VPCS1  10.0.10.10/24        10.0.10.1         00:50:79:66:68:00  
VPCS2  192.168.1.100/24     192.168.1.254     00:50:79:66:68:01  
VPCS3  0.0.0.0/0            0.0.0.0           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  10.0.10.10/24        10.0.10.1         00:50:79:66:68:00  20000  127.0.0.1:30000
       fe80::250:79ff:fe66:6800/64
VPCS2  192.168.1.100/24     192.168.1.254     00:50:79:66:68:01  20001  127.0.0.1:30001
       fe80::250:79ff:fe66:6801/64
VPCS3  0.0.0.0/0            0.0.0.0           00:50:79:66:68:02  20002  127.0.0.1:30002
       fe80::250:79ff:fe66:6802/64

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                    
         |                |
nio_udp:30000:127.0.0.1:20000
                 |
            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: 127.0.0.1 - 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

Issues

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.

References