Dynamips server up and running

So I’ve got everything almost as I want it. Dynamips is running fine and I’m using SecureCRT to log into all my routers. I normally use Putty but it isn’t a tabbed application, so SecureCRT fits the bill.

I’m going to share my configuration here, but please be aware that you’ll need to change certain things to fit your topology. My simplified topology looks like so:


Dynamips/Dynagen will be running on the server alone. I’ll be accessing the emulated routers from my main PC. Network-wise the server only really has to have a connection to the local network. This is the configuration of my network on Ubuntu:

$sudo less /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

If you have DHCP setup, you could always allow the server to get a dynamically assigned IP, but I recommend against this. This will cause issues later when telnetting it as the IP will consistently change.

Now for my dynagen configuartion file. This will need a fair amount of editing from you in order to work on your system. You’ll need to change the folder names as well as the image names to match what it is on your system.

$ sudo less /data/dynamips/Topology/inet.net

workingdir = /data/dynamips/working

 image = /data/dynamips/IOS_Images/3745/c3745-adventerprisek9-mz.124-25b.UNCOMPRESSED.bin
 ram = 128
 disk0 = 16
 disk1 = 0
 mmap = true
 ghostios = true

# Define router instances
[[Router R1]]
  model = 3745
  console = 2001
  autostart = false

[[Router R2]]
  model = 3745
  console = 2002
  autostart = false

[[Router R3]]
  model = 3745
  console = 2003
  autostart = false

[[Router R4]]
  model = 3745
  console = 2004
  autostart = false

[[Router R5]]
  model = 3745
  console = 2005
  autostart = false

[[Router R6]]
  model = 3745
  console = 2006
  autostart = false

[[Router R7]]
  model = 3745
  console = 2007
  autostart = false

Keep adding more routers as you see fit. I’ve got the option of autostart = false in each router instance. This is to prevent the routers starting up automatically when I load up the topology. If you want them to start up automatically, just remove this line under each router as the default is for them to start up.

I have no idle-pc vaules set yet. This is a very important step and I’ll cover this in a new post.

Now to test we can start it all up. First we need to load up dynamips to run in the background like so:

$sudo dynamips -H 7200 &

Now we can load up our topology:

$sudo dynagen /data/dynamips/Topology/inet.net

We should see something like this:

~$ sudo dynagen /data/dynamips/Topology/inet.net
Reading configuration file...
Shutdown in progress...
Shutdown completed.
CPU0: carved JIT exec zone of 64 Mb into 2048 pages of 32 Kb.
NVRAM is empty, setting config register to 0x2142
C3745 instance 'ghost-c3745-adventerprisek9-mz.124-25b.UNCOMPRESSED.bin-localhost.ghost' (id 20):
  VM Status  : 0
  RAM size   : 128 Mb
  NVRAM size : 128 Kb
  IOS image  : /data/dynamips/IOS_Images/3745/c3745-adventerprisek9-mz.124-25b.UNCOMPRESSED.bin

Loading ELF file '/data/dynamips/IOS_Images/3745/c3745-adventerprisek9-mz.124-25b.UNCOMPRESSED.bin'...
ELF entry point: 0x80008000

C3745 'ghost-c3745-adventerprisek9-mz.124-25b.UNCOMPRESSED.bin-localhost.ghost': starting simulation (CPU0 PC=0xffffffffbfc00000), JIT enabled.
C3745 'ghost-c3745-adventerprisek9-mz.124-25b.UNCOMPRESSED.bin-localhost.ghost': stopping simulation.
Network successfully loaded

Dynagen management console for Dynamips and Pemuwrapper 0.11.0
Copyright (c) 2005-2007 Greg Anuzelli, contributions Pavel Skovajsa


If we now type list, we can see all our router instances:

=> list
Name       Type       State      Server          Console
R1         3745       stopped    localhost:7200  2001
R2         3745       stopped    localhost:7200  2002
R3         3745       stopped    localhost:7200  2003
R4         3745       stopped    localhost:7200  2004
R5         3745       stopped    localhost:7200  2005
R6         3745       stopped    localhost:7200  2006
R7         3745       stopped    localhost:7200  2007

From here I can start my routers up as I see fit:

=>start R1

Or simply start them all up:

=>start /all

So now to access them, I access them from my Windows 7 PC. As a quick test I’m going to use the command prompt as it’s easy to copy and paste. The important thing to note from the list command previously is the port number. In my setup Router1 is on port 2001. So in order to now telnet to it I need to telnet to my servers IP ( as previously shown) on that port. So to connect to Router1 I do this from the Windows command prompt:

>telnet 2001

Connected to Dynamips VM "R1" (ID 0, type c3745) - Console port

% Please answer 'yes' or 'no'.
Would you like to enter the initial configuration dialog? [yes/no]:no

Press RETURN to get started!


So here we are connected to Router1! :) To connect to the others you just use port 2002, 2003 and so on. You can see now why it’s useful to have a tabbed telnet application.

In a future post I’ll show you how to connect these router interfaces to each other as well as looking at how to configure the idlepc values.

© 2009-2020 Darren O'Connor All Rights Reserved -- Copyright notice by Blog Copyright