Saturday, October 29, 2011

Installing GNS3 0.7.4 on Ubuntu 10.10 maverick

GNS3 is  an excellent tool  for graphical network simulator that allows simulation from simple to complex networks.A complementary tool for network engineers and people wanting to study for certifications such as Cisco as well as Juniper.

It can also emulate many Cisco IOS router platforms , PIX/ASA Firewalls and Juniper JunOS
The program is an open source, free program and  may be used on multiple operating systems, including Windows, Linux, and MacOS X.

 Check GNS3 documentation website for more details.
Check the old tutorial (for basic) and another for more advance users

My machine has Ubuntu 10.10 maverick (32-bit ).

1. Install Dynagen and Python-Qt4
 sudo apt-get update  
 sudo apt-get install dynagen python-qt4  

2. Install GNS3 
 cd /opt  
 sudo wget  
 sudo tar -xjvf GNS3-0.7.4-src.tar.bz2  
 sudo rm GNS3-0.7.4-src.tar.bz2  
 sudo mv GNS3-0.7.4-src /opt/GNS3  

3. Create directories in Ubuntu
 cd /opt/GNS3  
 sudo mkdir Dynamips  
 sudo mkdir IOS  
 sudo mkdir Project  
 sudo mkdir Cache  
 sudo mkdir tmp  
 sudo chmod o+rw -R ./Project  
 sudo chmod o+rw -R ./tmp  
 sudo chmod o+rw -R ./IOS  

4. Get Dynamips
 cd Dynamips  
 sudo wget  
 sudo chmod +x ./dynamips-0.2.8-RC3-community-x86.bin   

5. Install Qemu
 sudo apt-get install qemu  

6. Create the shortcut icon to run the application
use command: python "/opt/GNS3/gns3"

BUT you may get any of the Dynamips error message  below (depending on the operating system you use):
206-unable to create UDP NIO
206-unable to create generic ethernet NIO
206-unable to create Linux raw  Ethernet NIO

Seems that GNS3 requires root privileges for creating new virtual interfaces so you may use gksu (if use GNOME in Linux) or kdesu (for KDE)

command : gksu python "/opt/GNS3/gns3"

7. Edit Parameters in GNS3
start GNS3 and goto edit

Select your preferenable terminal application
preferences |General |terminal settings 

Preconfigured Terminal commands
select "Gnome Terminal " then click on "Use"

preferences General settings| Paths |
Project directory : /opt/GNS3/Project
Image Directory : /opt/GNS3/IOS

preferences |Dynamips|
executable path :/opt/GNS3/Dynamips/dynamips-0.2.8-RC3-community-x86.bin
working directory : /opt/GNS3/tmp

|preferences |capture |
working directory for capture files : /opt/GNS3/Project

preferences |Qemu |
path to Qemuwrapper : /opt/GNS3/qemuwrapper/
qemu path : /usr/bin/qemu 
qemu-img path : /usr/bin/qemu-img

8. Test Dynamips and Qemu
Edit| Preference | dynamips

click TEST and you should get  
Dynamips successfully started

Edit| Preference | Qemu
click TEST and you should get
Qemuwrapper, qemu and qemu-img have succefully started

9. Fine Tuning
Uncompress Cisco IOS 
To get rid of a slow Cisco router IOS self decompressing image sequence, uncompress the image and then use the uncompressed image.

 $ ls  
 $ unzip -p c3660-jk9o3s-mz.124-17.bin > c3660-jk9o3s-mz.124-17.image  
 warning [c3660-jk9o3s-mz.124-17.bin]: 101960 extra bytes at beginning or within zipfile  
  (attempting to process anyway)  
 $ ls  
 c3660-jk9o3s-mz.124-17.bin c3660-jk9o3s-mz.124-17.image   

Then set GNS3 to load the .image IOS

Use Konsole instead of Gnome Terminal
Because for big networks is easy to jump from one device to another since only one window opens with tabs for each equipment.

If Konsole is not installed then install it :
 sudo apt-get install konsole  
start GNS3 and goto
Edit|preferences |General |terminal settings 
Preconfigured Terminal commands
select "Kosnole (Linux KDE) " then click on "Use"

Preconfigured Terminal commands :
/usr/bin/konsole --new-tab -p tabtitle=%d -e telnet %h %p >/dev/null 2>&1 &

Note : Make sure that you have correct path


Anonymous said...

thank u dude

Anonymous said...

Thank you so much. I was about to take a hammer to my server before reading this blog! Thankyou thankyou thankyou!!!