Showing posts with label gns3. Show all posts
Showing posts with label gns3. Show all posts

Saturday, June 18, 2016

Installing lastest version (1.4.6) of GNS3 in Ubuntu/Debian

GNS3 is a Graphical Network Simulator that allows emulation of
complex networks. In this lab am going to show you how to install the lasted version of it on Ubuntu/Debian distributions.
This lab was full tested in Debian 8 and Deepin 15. If you face any issue please drop me a comment.

1. Install dependencies

a. GNS3 dependencies

sudo apt-get install gcc
sudo apt-get install python3-setuptools
sudo apt-get install python3-dev
sudo apt-get install python3-netifaces
sudo apt-get install python3-pyqt4
sudo apt-get install python3-ws4py
sudo apt-get install python3-tornado
sudo apt-get install python3-zmq

b. Dyamips dependencies
The dynamips hypervisor is a program that emulates Cisco MIPS based router hardware, allowing you to run select IOS image files in GNS3. Using dynamips you can run IOS images for Cisco c1700, c2600, c3600, 3700, and 7200 series routers.

sudo apt-get install cmake
sudo apt-get install libelf-dev
sudo apt-get install uuid-dev
sudo apt-get install libpcap-dev

2. Install GNS3 from source

a. Download it

Check the latest release from here,
https://github.com/GNS3/gns3-gui/releases

As on time of compiling this howto the lasted release was version 1.4.6

On download section, download the file with .source.zip extension.

Use the terminal to change to directory containing the dowloand file and extract it.

unzip GNS3-1.4.6.source.zip -d GNS3-1.4.6.source
cd GNS3-1.4.6.source

The GNS3 software is made up of two main components; a server application, and a GUI application. This provides a great amount of flexibility by allowing you to run multiple servers on different PCs. Leveraging this feature, you can create large GNS3 networks.

b. Install GNS3 server

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

During installation it will download some packages online, make sure it finishes, below is expected final output
.
.
Using /usr/lib/python3/dist-packages
Finished processing dependencies for gns3-server==1.4.6

c. Install GNS3 gui

unzip gns3-gui-1.4.6.zip
cd gns3-gui-1.4.6
sudo python3 setup.py install
cd ..

During installation it will download some packages online, make sure it finishes, below is expected final output
.
.

Using /usr/lib/python3/dist-packages
Finished processing dependencies for gns3-gui==1.4.6

d. Install Dynamips Hypervisor

unzip dynamips-0.2.16.zip
cd dynamips-0.2.16/
mkdir build
cd build
cmake ..
make
sudo make install
sudo setcap cap_net_admin,cap_net_raw=ep /usr/local/bin/dynamips
cd .././..

Make sure everything finishes without any error.

d. Install IOU prerequisites

sudo apt-get install libssl1.0.0:i386
sudo ln -s /lib/i386-linux-gnu/libcrypto.so.1.0.0 /lib/libcrypto.so.4
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install git
git clone http://github.com/ndevilla/iniparser.git
cd iniparser
make
sudo cp libiniparser.* /usr/lib/
sudo cp src/iniparser.h /usr/local/include
sudo cp src/dictionary.h /usr/local/include
cd ..

e. Install GNS3 IOUYAP

unzip iouyap-0.97.zip
cd iouyap-0.97/
sudo make install
sudo cp iouyap /usr/local/bin
cd ..

f. Install VPCS

unzip vpcs-0.6.1.zip
cd vpcs-0.6.1/src
./mk.sh
sudo cp vpcs /usr/local/bin/
cd ../..

g. Install Ubridge
unzip ubridge-0.9.4.zip
cd ubridge-0.9.4/
make
sudo make install
cd ..

3. Install other supporting software Cpulimit, Virtualbox, QEMU and Wireshart

The cpulimit application allows GNS3 to reduce CPU usage when running Cisco ASA devices in GNS3. With VirtualBox installed you can link emulated VirtualBox devices with other GNS3 devices. QEMU (Quick Emulator) is another PC hypervisor, and it is used to create and run Cisco ASA and other devices in GNS3. Wireshark is a powerful packet analyzer; using Wireshark you can sniff packets from your virtual GNS3 networks and analyze them, just as you can in the real world. Enter the following commands to complete your installation.

sudo apt-get install cpulimit
sudo apt-get install virtualbox
sudo apt-get install qemu
sudo apt-get install wireshark

4. Start GNS3
gns3

Note:
If you get below message:

Please install the PyQt5.QtSvg module

Install the module using the command:

sudo apt-get install PyQt5.QtSvg


After installation of the module you will be able to run gns3 on command line without problem.

Thursday, October 8, 2015

How to connect devices running on GNS3 to Internet in Ubuntu/Deepin

Hello everyone, you may came in a situation where you will need to connect devices running on visualization environment like GNS3 to Internet, here are steps.

i. Launch gns3 on command line
➜  ~  sudo gns3

ii. Add devices
For this lab, am going to use one router Cisco router 7200 and Cloud which will be connecting gns3 devices to Internet via my laptop which is connected to Internet using Ethernet cable connected to router .


iii. Cabling and bridging Cloud to the to my Ethernet interface.

Right-click on Cloud and select configure, then add etho (which is interface of my laptop as generic interface of the cloud) and then Appy and save.


Now connect interface of the router to this generic interface of the cloud.
Now power on the router for further configuration.

iv. Router Configuration
Now login to the router for configuration

➜  ~  telnet 127.0.0.1 2001
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connected to Dynamips VM "R1" (ID 1, type c7200) - Console port
Press ENTER to get the prompt.
ROMMON emulation microcode.

 a. Configure interface
Configure the interface to obtain IP address via dhcp of my public router (you may assign static IP also if you prefer).


R1#show ip interface brief Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        unassigned      YES unset  administratively down down  
R1#
R1#config tEnter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface fastEthernet 0/0R1(config-if)#ip address dhcp
R1(config-if)#no shutdown
R1(config-if)#
R1(config-if)#

*Oct  8 13:06:28.963: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Oct  8 13:06:29.963: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#
*Oct  8 13:06:37.907: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 192.168.0.17, mask 255.255.255.0, hostname R1

R1(config-if)#
As you can see the interface is assigned 192.168.0.17 IP from the router dhcp

b. Configure default gateway
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.1


Now you are able to access the internet from the router

R1#ping 8.8.8.8 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 160/169/196 ms
R1#
c. Further config to enable users to login to the router remotely, configure passwords and also dns configuration.

Dns configuration

R1(config)#ip domain lookup
R1(config)#ip name-server 8.8.8.8 8.8.4.4

Configure password to allow remote login

R1(config)#line console 0
R1(config-line)#transport preferred none
R1(config)#line vty 0 4
R1(config-line)#transport preferred none 
R1(config)#username admin secret admin@2015
R1(config)#enable secret admin@2015
R1(config)#service password-encryption 
R1(config)#aaa new-model
R1(config)#aaa authentication login default local
R1(config)#aaa authentication enable default enable
      R1(config)#exit
      R1#wr

Ping google.com to test DNS

R1#ping google.com
Translating "google.com"...domain server (192.168.0.1) [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 41.220.141.187, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/16/28 ms
R1#


Now your good, the router is online, and anyone within your network can login.

Enjoy!!!!!.




Saturday, September 12, 2015

How to Install GNS 1.3.10 in Ubuntu 14.04/Deepin 2014.3

Graphical Network Simulator-3 (GNS3) is a software emulator for networks, launched in 2008. It allows the combination of virtual devices and real devices, and so can be used to simulate complex networks. It uses Dynamips emulation software to simulate Cisco IOS.Below are steps of how to install it on Ubuntu/Deepin from official documentation found here , which i modified a bit to match with new version GNS 1.3.10

#Run apt-get update
➜  ~  sudo apt-get update

# - Install GNS3 Python dependencies
➜  ~  sudo apt-get install python3-setuptools python3-pyqt4 python3-ws4py python3-netifaces python3-crypto


#- Install Dynmips dependencies
➜  ~  sudo apt-get install cmake libelf-dev uuid-dev libpcap-dev

# - Download and unzip GNS3 Linux source files here
Migrade to your download directory and unzip the file

➜ unzip GNS3-1.3.10.source.zip
Results:
Archive:  GNS3-1.3.10.source.zip
 extracting: dynamips-0.2.14.zip  
 extracting: iouyap-0.95.zip      
 extracting: ubridge-0.9.0.zip    
 extracting: vpcs-0.6.1.zip        
 extracting: gns3-server-1.3.10.zip
 extracting: gns3-gui-1.3.10.zip

# - Build and Install Dynamips
➜  ~ unzip dynamips-0.2.14.zip
➜  ~ cd dynamips-0.2.14
➜  ~ mkdir build
➜  ~ cd build
➜  ~ cmake ..
➜  ~ make
➜  ~ sudo make install
➜  ~ sudo setcap cap_net_admin,cap_net_raw=ep /usr/local/bin/dynamips
➜  ~ cd ../..

# - Install GNS3 Server
➜ ~ unzip gns3-server-1.3.10.zip
➜ ~ cd gns3-server-1.3.10
➜ ~ sudo python3 setup.py install
➜ ~ cd ..

# - Install GNS3 GUI
➜ ~ unzip gns3-gui-1.3.10.zip
➜ ~ cd gns3-gui-1.3.10
➜ ~ sudo python3 setup.py install
➜ ~ cd ..

# - Install IOU dependencies
➜ ~ sudo apt-get install libssl1.0.0:i386
➜ ~ sudo ln -s /lib/i386-linux-gnu/libcrypto.so.1.0.0 /lib/libcrypto.so.4
➜ ~ sudo apt-get install bison
➜ ~ sudo apt-get install flex
➜ ~ git clone http://github.com/ndevilla/iniparser.git
➜ ~ cd iniparser
➜ ~ make
➜ ~ cd ..
➜ ~ sudo cp libiniparser.* /usr/lib/
➜ ~ cd iniparser
➜ ~ sudo cp libiniparser.* /usr/lib/
➜ ~ sudo cp src/iniparser.h /usr/local/include
➜ ~ sudo cp src/dictionary.h /usr/local/include
➜ ~ cd ..

# - Install GNS3 IOUYAP app (provides network support for IOU)
➜ ~ unzip iouyap-0.95.zip
➜ ~ cd iouyap-0.95
➜ ~ sudo make install
➜ ~ sudo cp iouyap /usr/local/bin
➜ ~ cd ..

# - Install VPCS
➜ ~ unzip vpcs-0.6.1.zip
➜ ~ cd vpcs-0.6.1/src
➜ ~./mk.sh
➜ ~ sudo cp vpcs /usr/local/bin
➜ ~ cd ../..

# - Install VirtualBox
➜ ~ sudo apt-get install virtualbox

# - Install Wireshark
➜ ~ sudo apt-get install wireshark

# - Install QEMU - method 1
$ sudo apt-get install qemu
# - Install QEMU - method 2 (x86 arch. only)
$ sudo apt-get install qemu-system-x86
$ sudo apt-get install qemu-utils

# - Install cpulimit
$ sudo apt-get install cpulimit

# - Start GNS3
➜ ~ gns3

Note:
Don't include ➜ ~ when copying the command as that is Deepin terminal prompt.


Enjoy!