My favorites | Sign in
Project Logo
                
Search
for
Updated Sep 19, 2007 by Pavel.Skovajsa
Labels: Phase-Deploy
configmodetutorial  
configuration mode tutorial

Introduction

Dynagen configuration mode allows you to dynamically change your lab, by editing the .net config "on the fly" - interactively. You can add/change/remove all lab/router options that are available in the .net files without restarting your lab. You can also add/change/remove hypervisors without restarting your lab.

There are two options to run confDynagen:

Example

Dynagen management console for Dynamips

#--- we ran dynagen without any command line option to start from scratch. There is, of course, possibility to run dynagen as with .net file as an argument

=> conf localhost
Hypervisor on localhost:7200 created

#--- this command added the hypervisor running on localhost:7200 to the lab. No need to specify 7200 here as it is the default port. In case you would need another port type something like 'localhost:7201'

=>(config-localhost:7200)help
Documented commands (type help <topic>):
========================================
2691 3640 3725 7200 help no router
3620 3660 3745 exit hist py workingdir

#--- everybody who works with Cisco routers knows what this means we jumped into config mode in this case a hypervisor config mode. Here is a list of commands available

=>(config-localhost:7200)7200

#--- first we need to set the default options for our future routers. This is configured under section 7200 (same as in the .net file). Minimum setting is the IOS image path.

=>(config-localhost:7200-7200)help
Documented commands (type help <topic>):
=======================================
cnfg disk0 exit help idlemax idlesleep midplane npe py slot
confreg disk1 ghostios hist idlepc image no nvram ram

#--- or we can set any other option, or unset it with no command similarly as in Cisco CLI

=>(config-localhost:7200-7200)image = C:\IOS\C7200-jk9s-mz.124-12.bin
C7200-jk9s-mz.124-12.bin found in user idlepc database
Setting idlepc value to 0x60654b68

#--- setting your image, also tries to find out the idlepc value in the idlepc database

=>(config-localhost:7200-7200)npe
npe = <npe type>
set NPE type. Choose "npe-100", "npe-150", "npe-175", "npe-200", "npe-225", "npe-300" or "npe-400"
=>(config-localhost:7200-7200)npe = npe-400
=>(config-localhost:7200-7200)exit
Exiting...
=>(config-localhost:7200)router R1
Router R1 created

#--- router

<router_name>
<model> command creates a new router with specified model and name. All options set under model default config get applied onto the router. The default model is 7200, so we could use command 'router R1' instead of 'router R1 model 7200' (which will work too). Also this will take you directly into router config mode.

=>(config-localhost:7200-router R1)exit
Exiting...
=>(config-localhost:7200)router R2
Router R2 created
=>(config-localhost:7200-router R2)help
Documented commands (type help <topic>):
========================================
a confreg e f help idlepc midplane nvram py se
at disk0 et fa hist idlesleep no p ram slot
cnfg disk1 exit ghostios idlemax image npe po s

#--- under router R2 router config mode we can set specific options like (midplane, nvram size, disk0 size etc.) for this specific router. The 'a', 'f', 'e' commands are for creating connections between routers.

=>(config-localhost:7200-router R2)f0/0 = R1 f0/0

#--- Here is an example of connection creation. The syntax is the same as in .net files. Syntax for disconnecting this connection would be the Cisco CLI form: no f0/0 = R1 f0/0. Every other option can be removed by using the no version of the command.

=>(config-localhost:7200-router R2)exit
Exiting...
=>(config-localhost:7200)exit
Exiting...
=> show run
autostart = False
[localhost:7200]
[[7200]]
npe = npe-400
image = C:\IOS\C7200-jk9s-mz.124-12.bin
idlepc = 0x60654b68
[[ROUTER R1]]
model = 7200
F0/0 = R2 F0/0
[[ROUTER R2]]
model = 7200
F0/0 = R1 F0/0

#--- show run command displays the running configuration of current lab in the .net file format

=> start /all
100-C7200 'R1' started
100-C7200 'R2' started

#--- we start our routers

=> conf localhost

#--- after the routers are started we can still go to config mode and add/change/remove stuff. The changes are reflected on the routers either immediately, or after router reload depends on the type of option changed.

=>(config-localhost:7200)router R1

#--- if router R1 already exists (this is the case now) this is the way we can get into the router config mode to add/change/remove any router variable

=>(config-localhost:7200-router R1)f1/0 = R2 f2/0

#--- here we added a new connection on the fly. As you can see in the 'show run' output above there is no adapter card in slot 1 in our 7206. This command will virtually insert the card (PA-FE-TX in this example) into slot1 and create the connection between both routers. This could be seen on the router as an OIR (online insertion removal) event:

%OIR-6-INSCARD: Card inserted in slot 1, interfaces administratively shut down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to down
%ENTITY_ALARM-6-INFO: ASSERT INFO Fa1/0 Physical Port Administrative State Down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to down

#---As you might know, only high-end routers like 720x support hot-insertion and removal of port adapters, so this is not supported on 36x0 or other low-end routers. However you can still create/delete connections between two 3660 routers, provided you have the network modules ALREADY inserted since the router started.

=>(config-localhost:7200-router R1)exit
Exiting...
=>(config-localhost:7200)exit
Exiting...
=> show run
autostart = False
[localhost:7200]
[[7200]]
npe = npe-400
image = C:\IOS\C7200-jk9s-mz.124-12.bin
idlepc = 0x60654b68
[[ROUTER R1]]
model = 7200
F0/0 = R2 F0/0
slot1 = PA-FE-TX
F1/0 = R2 F2/0
[[ROUTER R2]]
model = 7200
F0/0 = R1 F0/0
slot2 = PA-FE-TX
F2/0 = R1 F1/0

#--- show run output reflects the change

=> copy run start

#---after finishing your work you can save it back into .net file. This will also save the NVRAM config into from the routers into the .net file under 'configuration' option, similarly as you would do with 'save /all' command


Comment by jyotirmay.samanta, Dec 22, 2007

I am novice to Dynamips and Dynagen ....So very sorry if I am asking some stupid question. I started Dynamips server first and then started Dynagen. Then in Dynagen I given the conf localhost command. But that shuts down the dynamips server. And if I don't run the dynamips server first then if I give the conf local host command in Dynagen it says unable to connect to Dynamips server at port 7200. Can u pls guide me.

Comment by vikas.k.srivastava, Dec 29, 2007

Amazing Piece of Work !!! I am in Love with It , Thank you very much :-)

Comment by omar.baceski, Jan 07, 2008

way to go!!!

Comment by yandyr, Jan 07, 2008

great stuff!!!


Sign in to add a comment
Hosted by Google Code