Emulating Cisco IOS on Slackware using Dynamips and Dynagen

Home / Emulating Cisco IOS on Slackware using Dynamips and Dynagen

If you are a students / lecturer / alumnus of Cisco Networking Academy, you can use Packet Tracer for experiment with network especially using Cisco devices. Alternatively we can use dynamips to simulates network. In this article we will discuss about how to install Dynamips and Dynagen to emulates Cisco’s devices on Slackware.

In this article, I use:

  1. Slackware64 14.0 with multilib support.
  2. Dynamips 0.2.8 RC3 for linux
  3. Dynagen

Multilib support is not a must as there are two version of dynamips for Linux, 32-bit and 64-bit.

Dynamips and Dynagen Overview

Dynamips is a software that emulates Cisco IOS on a traditional PC (means our everyday machine). This project started by Christophe Fillot. Initially it emulates Cisco 7200 device and now supports Cisco 3600 series (3620, 3640, and 3660), 2700 series (3725, 2745) and 2600 series (2610 to 2650XM, 2691).

Cristophe Fillot states that this project goals are:

  1. Obtain the Materialsto be used as a training platform, which software used in real world. Allow people to become more familiar with Cisco devices.
  2. Test and experiment the numerous and powerful features of Cisco IOS.
  3. Check quickly configurations to be deployed later on real routers

Note that, this is just an emulator, which can’t replace real router. You can read more from his site on http://www.ipflow.utc.fr/index.php/Cisco_7200_Simulator.

Dynagen is a text-based front end for Dynamips, which use the “Hypervisor” mode for communication with Dynamips. Dynagen is no longer officially maintained, however Dynagen is still updated and developed for used on GNS3.

Dynagen can run on any platform which supports Python.

Obtain the Materials

Now download the materials. The Dynamips and Dynagen we used are provided by GNS3 (http://www.gns3.net)

If you use Slackware 32-bit, you can download Dynamips 0.2.8-RC3-community for Linux 32-bit. If you use Slackware64, you can download Dynamips 0.2.8-RC3-community for Linux 64-bit. If you use multilib support, you can choose either 32-bit or 64-bit, but I recommended you to use the 64-bit one.

Next, download the source for dynagen. The one we use is dynagen-0.11.0tar.gz. You can obtain it on Sourceforge which located here.

If you have not installed libpcap before, you need to download and install it first.

Installation

Create a new directory /opt/dynamips. The dynamips will be installed to /opt/dynamips and dynagen will be installed to /opt/dynagen (will be created later) respectively.

Now go to /opt.dynamips. Create bin and images directories. Move your dynamips-0.2.8-RC3-community-x86_64.bin (or dynamips-0.2.8-RC3-community-x86.bin) to /opt.dynamips/bin.

Next, copy your dynagen file to /opt. Extract it with the following command:

tar -xf dynagen-0.11.0.tar.gz dynamips-0.2.8-RC3-community-x86_64.bin

You should have a new directory dynagen-0.11.0. Now rename it to dynagen. Thus you now have /opt/dynagen. Then creat a new directory /opt/dynagen/labs.

Remember that you need libpcap if you haven’t install it.

Preparing Cisco IOS Images

Dynamips emulates Cisco devices. Technically speakin, it is running real Cisco IOS images. Thus, to have dynamips run properly (maybe the right word is: to be able to run dynamips), you need to provide Cisco IOS. They can be obtained by dumping the real machines, if you have. Another way is used the images provided by other people. Unfortunately, neither I or dynamips official can not provide you with the images. And yes, you should find it by yourself.

The images supported by dynamips (by current version) are (at least what I have):

  1. 7200
  2. 4000 series
  3. 4500 series
  4. 3600 series (3620, 3640, and 3660)
  5. 2900 series (
  6. 2700 series (3725, 2745)
  7. 2600 series (2610 to 2650XM, 2691)
  8. 1600 series
  9. 1000 series

Place the images on /opt/dynamips/images/.

The Cisco images are compressed. This compressed images will work just fine with Dynamisp, however the boot process is slowed significantly with decompression process. It is recommended to decompress the images beforehand so the emulator doesn’t have to. Do the following if you want:

unzip -p "images file.bin" > "images file.image"

Yes you can substitute with your images filename. Note that for some images, you must uncompressed it first to work with Dynamips.

Usage

Using dynamips and dynagen, we are working with virtual lab. The configuration of all routers, switch, and interconnections that make up the virtual lab are stored on a single “network file”. This file is simply an INI file-like.

Lets start up with a simple virtual lab. Create a new directory /opt/dynagen/labs/simple. Next, create a new file simple1.net write following to it.

# Simple lab
[localhost]
[[7200]]
image = /opt/dynamips/images/c7200-jk9s-mz.124-13b.bin
npe = npe-400
ram = 160
[[ROUTER R1]]
s1/0 = R2 s1/0
[[router R2]]
# Nothing to do

We create a simple net with two routers, R1 and R2. The network is running on localhost, the same machine which run Dynagen. In this network we register a cisco device, router 7200 and specify the images as /opt/dynamips/images/c7200-jk9s-mz.124-13b.bin.  For each instance of 7200 will use an NPE-400 and use 160MB of RAM resource.

Now the topology. R1 has a serial port name S1/0 which is connected to R2’s port of S1/0.  This connection is virtual connection. Dynagen will automatically install a PA-8T adapter in Port 1 on both R1 and R2. On R2, we can omit the adapter as the adapter has been specified before.

In order to run this virtual lab, first start up the dynamips server. Invoke following command:

dynamips -H 7200 &

The 7200 is not the Cisco device, but a port dynamips listening to. Next, load the configuration file to dynagen:

dynagen /opt/dynagen/labs/simple1.net

And there you should see the Cisco IOS is running 😀

, ,

About Author

about author

xathrya

A man who is obsessed to low level technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

Social media & sharing icons powered by UltimatelySocial