Archive

Posts Tagged ‘Dynagen’

HOWTO: Dynamips .NET file for use with real switches

May 11th, 2011 jose No comments

When I first started studying, it took a bit of work to figure out how to setup my Dynamips network with my real switches. I am hoping that this guide may help others when beginning their CCIE studies and using a home lab. For starters, I used the topology from here. Within the zip file you download, there are various .net files for use with studying. I downloaded this zip file and put it into the /opt/dynamips/ directory which was created when installing Dynamips on Ubuntu. Because I am studying for the Routing and Switching exam, I used ine.routing.and.switching.topology.5.00.net. So for starters, the first thing I did was to create a new file called ine.routing.and.switching.topology.5.00.switches.net, which I then use with my real switches.

root@yoda:/opt/dynamips/internetworkexpert# cp ine.routing.and.switching.topology.5.00.net ine.routing.and.switching.topology.5.00.switches.net

Another file contained in the zip file is called dynamips-start.cmd, which is a batch file of sorts, which has this in it:

@echo off
rem Launch a local copy of dynamips
start /belownormal /min “Dynamips” “dynamips.exe” -H 7200
start /belownormal /min “Dynamips” “dynamips.exe” -H 7201

Borrowing from that file, I created a file called start.dynamips that I use to start my instances of Dynamips.

root@yoda:/opt/dynamips/internetworkexpert# vi start.dynamips

dynamips -H 7200 & sleep 2;
dynamips -H 7201 & sleep 2;

I then have to make this file executable in order to start my instances of Dynamips.

root@yoda:/opt/dynamips/internetworkexpert# chmod +x start.dynamips

This now allows me to start my instances of Dynamips (Hypervisor) by simply doing:

root@yoda:/opt/dynamips/internetworkexpert# ./start.dynamips
Cisco Router Simulation Platform (version 0.2.8-RC2-amd64)
Copyright (c) 2005-2007 Christophe Fillot.
Build date: Jan 18 2011 19:25:29

ILT: loaded table “mips64j” from cache.
ILT: loaded table “mips64e” from cache.
ILT: loaded table “ppc32j” from cache.
ILT: loaded table “ppc32e” from cache.
Hypervisor TCP control server started (port 7200).
Cisco Router Simulation Platform (version 0.2.8-RC2-amd64)
Copyright (c) 2005-2007 Christophe Fillot.
Build date: Jan 18 2011 19:25:29

ILT: loaded table “mips64j” from cache.
ILT: loaded table “mips64e” from cache.
ILT: loaded table “ppc32j” from cache.
ILT: loaded table “ppc32e” from cache.
Hypervisor TCP control server started (port 7201).

Once that is all squared away, we can concentrate on the important file, which is what controls how our routers behave. Opening up the newly created file, we get:

root@yoda:/opt/dynamips/internetworkexpert# vi ine.routing.and.switching.topology.5.00.switches.net
###########################
#
# Define router instances
#
###########################

[[Router R1]]
model = 3725
console = 2001
autostart = false
#slot1 = NM-4T
F0/0 = SW1 F1/1
S0/0 = FRSW 1
cnfg = /Applications/Dynagen/sample_labs/internetworkexpert/initial.configs/R1.initial.config.txt

Because we are using real switches, we need to change the behavior of our routers to make them use physical ports instead of the ports defined by INE. From the .NET file, you can see that R1′s FastEthernet0/0 is directly connected to SW1 FastEthernet1/1. While this is fine if you are only using Dynamips, we are not and we need to edit this to make R1 use our physical port. The change looks like this:

###########################
#
# Define router instances
#
###########################

[[Router R1]]
model = 3725
console = 2001
autostart = False
#slot1 = NM-4T
F0/0 = NIO_gen_eth:eth5
S0/0 = FRSW 1
#cnfg = /opt/dynamips/internetworkexpert/initial.configs/R1.initial.config.txt
idlepc = 0x614ac27c

Obviously, in this case I am using the eth5 interface to connect the R1 Fast0/0 interface to SW1 FastE0/1. This depends greatly on your own setup and the eth interface will vary according to how your box is setup. Beyond this, I removed any reference to SW1, SW2, SW3 and SW4 from this .NET file. This means that I will rely on my external switches for connectivity. If you want to view my .NET file, click here

As a point of reference, here is how my ports are setup (note: due to an odd naming structure, there is no eth12, instead one of them is named eth7-eth9. Not sure why that is, but didnt feel like spending time troubleshooting the issue when everything else works just fine):

[[Router R1]]
F0/0 = NIO_gen_eth:eth5
[[Router R2]]
F0/0 = NIO_gen_eth:eth6
[[Router R3]]
F0/0 = NIO_gen_eth:eth7
F0/1 = NIO_gen_eth:eth8
[[Router R4]]
F0/0 = NIO_gen_eth:eth11
F0/1 = NIO_gen_eth:eth9
[[Router R5]]
F0/0 = NIO_gen_eth:eth7-eth9
F0/1 = NIO_gen_eth:eth10
[[Router R6]]
F0/0 = NIO_gen_eth:eth1
F0/1 = NIO_gen_eth:eth2
[[Router BB2]]
F0/0 = NIO_gen_eth:eth3
[[Router BB3]]
F0/0 = NIO_gen_eth:eth4

When the time comes for me to start my labs, here is what I do.

root@yoda:/home/jose# cd /opt/dynamips/internetworkexpert/
root@yoda:/opt/dynamips/internetworkexpert# ./start.dynamips
Cisco Router Simulation Platform (version 0.2.8-RC2-amd64)
Copyright (c) 2005-2007 Christophe Fillot.
Build date: Jan 18 2011 19:25:29

ILT: loaded table “mips64j” from cache.
ILT: loaded table “mips64e” from cache.
ILT: loaded table “ppc32j” from cache.
ILT: loaded table “ppc32e” from cache.
Hypervisor: unable to create TCP sockets.
Shutdown in progress…
Shutdown completed.
Cisco Router Simulation Platform (version 0.2.8-RC2-amd64)
Copyright (c) 2005-2007 Christophe Fillot.
Build date: Jan 18 2011 19:25:29

ILT: loaded table “mips64j” from cache.
ILT: loaded table “mips64e” from cache.
ILT: loaded table “ppc32j” from cache.
ILT: loaded table “ppc32e” from cache.
Hypervisor: unable to create TCP sockets.
Shutdown in progress…
Shutdown completed.
root@yoda:/opt/dynamips/internetworkexpert# dynagen ine.routing.and.switching.topology.5.00.switches.net
Reading configuration file…

Network successfully loaded

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

=> list
Name Type State Server Console
TermServ 3725 stopped localhost:7201 2000
R1 3725 stopped localhost:7200 2001
R2 3725 stopped localhost:7200 2002
R3 3725 stopped localhost:7200 2003
R4 3725 stopped localhost:7200 2004
R5 3725 stopped localhost:7201 2005
R6 3725 stopped localhost:7201 2006
BB1 3725 stopped localhost:7201 2011
BB2 3725 stopped localhost:7201 2012
BB3 3725 stopped localhost:7201 2013
FRSW FRSW always on localhost:7201 n/a
=> start /all 5
100-VM ‘R4′ started
Delaying start of next device for 5 seconds…
100-VM ‘R5′ started
Delaying start of next device for 5 seconds…
100-VM ‘R6′ started
Delaying start of next device for 5 seconds…
100-VM ‘R1′ started
Delaying start of next device for 5 seconds…
100-VM ‘R2′ started
Delaying start of next device for 5 seconds…
100-VM ‘R3′ started
Delaying start of next device for 5 seconds…
Warning: Starting TermServ with no idle-pc value
100-VM ‘TermServ’ started
Delaying start of next device for 5 seconds…
100-VM ‘BB3′ started
Delaying start of next device for 5 seconds…
100-VM ‘BB2′ started
Delaying start of next device for 5 seconds…
100-VM ‘BB1′ started
=>

Notes

    1. I did not note the fact that I also made changes to the workingdir and image variables
    workingdir = /opt/dynamips/working
    image = /opt/dynamips/ios/c3725-adventerprisek9-mz.124-15.T10.extracted.bin

    2. The #cnfg variable for every router is commented out. This allows the router to load previous configs and will likely be a topic for another post.

Categories: How-To Tags: , ,