Installing dynamips dynagen gns3 from source

From Internetworkpro

Jump to: navigation, search
Blank.png This page contains configuration examples or information on dynamips
The examples on this page are intended for use with dynamips, the Cisco router emulator. This information is not intended for use on hardware routers, and is primarily used for troubleshooting, testing, and certification lab study.
Support of Dynamips is found on Hackis_Forum. For other dynamips pages see Category:Dynamips

This guide is to help you install the latest dynamips, dynagen and gns3 from source.

GNU stow is utilized in this tutorial as I find it is a good way to keep my source packages separate while allowing proper /usr/local directory structure. You will have to adjust this tutorial accordingly to build your own packages using checkinstall or some other way if you do not like stow. (You can also use stow in you home directory as well. Replace /usr/local with ~/local!)

Why not use the packages for your distribution? This is a good option! I wanted the latest versions of dynamips and dynagen which are not available in the Ubuntu repositories and this allows me to be flexible.

Contents

[edit] Prerequisites

First you need to install some utilities for helping you build from source. I use Ubuntu at work so the following line will install everything needed to get started. If you have the lines needed to install the prerequisates for your distro, please add it below (it is a wiki after all)

[edit] Ubuntu

sudo aptitude install build-essential libelf1 libelf-dev libpcap0.8 libpcap0.8-dev python, python-support python-configobj python-qt4 stow

Stow will choke on Ubuntu's symlink of /usr/local/man to /usr/local/share/man. This will fix that. If you do not care about man pages, you can skip this step

cd /usr/local
sudo rm man
sudo mv share/man .
cd share
sudo ln -s ../man .


[edit] Prestaging

Lets get a directory for extracting our sources into.

mkdir ~/work
cd ~/work

[edit] Downloading the software

Get the lastest and greatest of dynamips, dynagen and gns3 with the following links

wget http://www.ipflow.utc.fr/dynamips/dynamips-0.2.8-RC2.tar.gz
wget http://superb-east.dl.sourceforge.net/sourceforge/dyna-gen/dynagen-0.10.1.tar.gz
wget http://pfe.epitech.net/frs/download.php/597/GNS3-0.3.2-src.tar.gz

And extract the images we just downloaded

tar zxfv dynamips-0.2.8-RC2.tar.gz
tar zxfv dynagen-0.10.1.tar.gz
tar zxfv GNS3-0.3.2-src.tar.gz

[edit] Installing

[edit] Dynamips

Dynamips should be ready to go out of the box. Please check the Makefile for settings you may need (like switching from x86 to x86_64)

cd dynamips-0.2.8-RC2
make
sudo make install DESTDIR=/usr/local/stow/dynamips-0.2.8-RC2
(cd /usr/local/stow && sudo stow dynamips-0.2.8-RC2)

[edit] Dynagen

There is no directory structure for dynagen. To make it work well I have created sort of a hack below to make it work well with stow. Love it or hate it (or come up with a better way and add to the wiki!)

mkdir dynagen-work
mkdir dynagen-work/{opt,bin,share,etc}
mkdir dynagen-work/share/dynagen
cp -R dynagen-0.10.1 dynagen-work/opt
cd dynagen-work
ln -s ../opt/dynagen-0.10.1/dynagen ./bin/dynagen
ln -s ../opt/dynagen-0.10.1/doc ./share/dynagen
ln -s ../opt/dynagen-0.10.1/sample_labs ./share/dynagen
ln -s ../opt/dynagen-0.10.1/COPYING ./share/dynagen
ln -s ../opt/dynagen-0.10.1/README ./share/dynagen
ln -s ../opt/dynagen-0.10.1/dynagen.ini ./etc
cd ..
sudo mv dynagen-work /usr/local/stow/dynagen-0.10.1
(cd /usr/local/stow && sudo stow dynagen-0.10.1)

[edit] gns3

Installing gns3 is the easiest. Just execute the two lines below.

sudo python setup.py install --prefix=/usr/local/stow/GNS-0.3.2
(cd /usr/local/stow && sudo stow GNS-0.3.2)

[edit] Upgrading with stow

To upgrade with stow just install the same as above with changing the /usr/local/stow directory to the new version number (no need to delete the old one). Run stow -D (delete) and stow on the new directory and you have upgraded that "package"

For example with dynamips:

(cd /usr/local/stow && sudo stow -D dynamips-0.2.8-RC2)
(cd /usr/local/stow && sudo stow dynamips-0.2.8-RC3)
Personal tools
Namespaces
Variants
Actions
Navigation
Categories
Toolbox