Zachary Loeber

I eat complexity and am never without a meal.

GNS3 on Ubuntu 8.04 – Install Guide

GNS3 is a frontend for dynagen (which is a scripting language for dynamips). Getting it to work nicely in Ubuntu was a bit of a pain in the arse but I was able to get it to work in a manner I’m happy with. This setup will essentially encapsulate a large portion of the install to one directory in /opt. Some libraries and executables will be installed through apt though, but not many. I previously wrote part of a writeup for this on Ubuntu 7.10, I’d ignore that in favor of this one which is much more up to date and polished.

Start by getting the right packages for it to work correctly:

sudo apt-get install dynagen python-qt4

Now get GNS3 and extract it to /opt<br /> cd ~<br /> http://pfe.epitech.net/frs/download.php/818/GNS3-0.5-src.tar.bz2<br /> tar xjvf GNS3-0.5-src.tar.bz2 && rm GNS3-0.5-src.tar.bz2<br /> sudo mv GNS3-0.5-src /opt/GNS3

Next we will create some directories. Dynamips will hold our executable dynamips. IOS for our Cisco images, Project for our projects, and Cache and tmp for extraneous files that clutter things up. We need to be able to write to Cache and tmp so we make those directories writable by the “other” group for simplicity sake.

<br /> cd /opt/GNS3<br /> sudo mkdir Dynamips<br /> sudo mkdir IOS<br /> sudo mkdir Project<br /> sudo mkdir Cache<br /> sudo mkdir tmp<br /> sudo chmod o+rw -R ./Project<br /> sudo chmod o+rw -R ./tmp<br />

Now get a binary of dynamips and make it executable

<br /> #Get the dynamips binary and make it executable:<br /> cd Dynamips<br /> sudo wget http://www.ipflow.utc.fr/dynamips/dynamips-0.2.8-RC2-x86.bin<br /> sudo chmod +x ./dynamips-0.2.8-RC2-x86.bin<br />

Now create a desktop shortcut to GNS3. Right-click on your desktop and select “Create Launcher…” and for the command put in

python "/opt/GNS3/gns3"

Start GNS3 with this new shortcut. Now we should start messing around with our settings.

If it is your first time launching it you have the option to changes settings right away. Go ahead and do this.

Here is the terminal command you will want to use for gnome, there are other terminal examples in the documentation, but this one worked the best for Ubuntu it seemed.

gnome-terminal -t %d -e 'telnet %h %p' > /dev/null 2>&1 &

When you are done with the general settings it should look something like this:

Here is the dynamips preferences tab:

And finally the capture preferences tab:

I will get back to doing Pemu in a different post 🙂

In the next post I will cover how to choose and setup your IOS image. I think that actually choosing an image can be more difficult than setting it up so stay tuned as I document a typical example for you.

**Update**

Ubuntu_Boy gives us the scoop on doing this for 64 bit Ubuntu architecture! The only note I’ll add is that you do not need to setup a root password to use “su -“, you can just use “sudo su -” and enter your password if you don’t want to use sudo all of the time. Also, you can follow the path convention used earlier to make your install more portable. I’ve not followed these directions yet but will test them out on my next 64 bit install.

Want to run GNS3 on 64 bit Ubuntu because of memory limitation,follow the instruction above except

sudo apt-get install dynagen python-qt4

this one won’t work in 64 bit …

instead follow this:

First you have to select system’s update sources:

Go to system > Administration > Software sources

[Type password in the pop up box]

Then,

Under “Ubuntu software” select 1 � 2

Under “Updates” select 1 � 2

Then click close and reload

Next you have to check if python v2.5 installed:

  1. Open Terminal windows
  1. type python
  1. you will get something like this:

“Python 2.5.1 (r251:54863, Oct 5 2007, 13:50:07)

[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2

Type “help”, “copyright”, “credits” or “license” for more information.

  1. Close is by pressing Ctrl+d [Skip 5 and 6 if you get the above message and go to 7]

[if you do not get the above message, python is not installed on your system]

  1. type “su -” [Without quotes ofcourse] [then type password]
  1. atp-get insall python [type y] [Skip 7 � 8 and go to 9]

  2. type “su -” [Without quotes ofcourse] [then type password]

  1. “apt-get update”
  1. “apt-get install qt4-dev-tools” [type y]
  1. “apt-get install pyqt4-dev-tools” [type y]
  1. “exit”
  1. “mkdir ~/Desktop/GNS3″ [A folder named GNS3 is created in the Desktop]
  1. “cd ~/Desktop/GNS3″
  1. “wget hthttp://pfe.epitech.net/frs/download.php/598/GNS3-0.3.2-src.tar.bz2″
  1. “tar -xf GNS3-0.3.2-src.tar.bz2″ [Extracts the Archive]
  1. “cd GNS3-0.3.2″

and here comes the interesting part

  1. “./gns3″

**

** End of Update ****