XpressLearn Home

Dynamips basics
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

 

Please note, this article represents the very basics of Dynamips. There are several add-on projects that have made Dynamips much more user friendly for the average person to configure. However, there is an old saying, “You must walk before you can run” that I truly believe in. So, this explanation will at least give you some root information on how Dynamips works by itself (walking). You will most likely run Dynamips using a ‘front end’ such as Dynagen or GNS3(running) which will be covered in other articles.

In this initial explanation, we will run a single virtual 7200 router instance that will have an Ethernet interface bridged with a network adapter on the host PC. By doing this, the host PC will be able to communicate to the virtual router just like it was a real router on a real network.

The first thing needed is to determine the PCAP string that represents the network adapter to be bridged with the virtual router interface. To do this run the dynamips executable with just a ‘-e’ option.

C:\Program Files\Dynamips>dynamips -e
Cisco Router Simulation Platform (version 0.2.8-RC1-x86)
Copyright (c) 2005-2007 Christophe Fillot.
Build date: Sep 7 2007 17:17:20

Network device list:

rpcap://\Device\NPF_{3A61C8A2-3B20-4C04-880D-C24930E29609} : Network adapter ‘Intel(R) PRO/1000 MT Mobile Connection – Deterministic Network Enhancer Miniport’ on local host
rpcap://\Device\NPF_{6BEED806-4E3F-41F9-A5E6-9E558ECFB2E3} : Network adapter ‘MS LoopBack Driver’ on local host
rpcap://\Device\NPF_{FCE28766-936D-4D4B-A534-CC9D50B477C5} : Network adapter ‘Intel(R) PRO/Wireless 2200BG Network Connectio’ on local host

The Windows interface we want to use for communication with the virtual router interface is the MS Loopback Driver. So the next step is to create a switch.cfg file, this will define the properties of the virtual switch.

IF:E0:udp:10001:127.0.0.1:10000
IF:E1:gen_eth:\Device\NPF_{6BEED806-4E3F-41F9-A5E6-9E558ECFB2E3}
ACCESS:E0:4
ACCESS:E1:4

The contents of this file will define the makeup of the virtual switch. In this particular virtual switch, there are two interfaces: E0 and E1. The virtual switch interface E0 will be sourced locally using udp port 10001 and will connect to port 10000, also residing on the localhost. The virtual switch interface E1 will be mapped to the Windows loopback adapter. Both ports are put in the same vlan, which is vlan 4 in this particular example. Once the file is created, you can run Dynamips like so:

dynamips-wxp.exe -X -i 996 -t npe-400 -r 256 -p 0:C7200-IO-FE -s 0:0:udp:10000:127.0.0.1:10001 c7200-spservicesk9-mz.124-11.T1.image -E switch.cfg

The above command string starts a single Dynamips 7200 instance with a C7200-IO card containing a single FastEthernet adapter, which will be FastEthernet0/0 inside the IOS. The -s option says take the adapter in slot0:port0 and map it’s input locally to udp port 10000 and direct it’s output traffic to udp port 10001 on the localhost. You will notice this is just the opposite of what is defined in the switch configuration file. Below is what you will see after running the command string above:

Cisco Router Simulation Platform (version 0.2.8-RC2-x86)
Copyright (c) 2005-2007 Christophe Fillot.
Build date: Oct 14 2007 10:54:51

Instance ID set to 996.
Virtual RAM size set to 256 MB.
IOS image file: ..\ios\c7200-spservicesk9-mz.124-11.T1.image

ILT: loaded table "mips64j" from cache.
ILT: loaded table "mips64e" from cache.
ILT: loaded table "ppc32j" from cache.
ILT: loaded table "ppc32e" from cache.
CPU0: carved JIT exec zone of 16 Mb into 512 pages of 32 Kb.
C7200 instance 'default' (id 996):
  VM Status  : 0
  RAM size   : 256 Mb
  IOMEM size : 0 Mb
  NVRAM size : 128 Kb
  NPE model  : npe-400
  Midplane   : vxr
  IOS image  : ..\ios\c7200-spservicesk9-mz.124-11.T1.image

Loading ELF file '..\ios\c7200-spservicesk9-mz.124-11.T1.image'...
ELF entry point: 0x80008000

C7200 'default': starting simulation (CPU0 PC=0xffffffffbfc00000), JIT enabled.
ROMMON emulation microcode.

Launching IOS image at 0x80008000...
Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706

Cisco IOS Software, 7200 Software (C7200-SPSERVICESK9-M), Version 12.4(11)T1, RE
LEASE SOFTWARE (fc5)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Thu 25-Jan-07 19:57 by prod_rel_team
Image text-base: 0x60009084, data-base: 0x62B1A000

This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:

http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

Cisco 7206VXR (NPE400) processor (revision A) with 245760K/16384K bytes of memory.
Processor board ID 4294967295
R7000 CPU at 150MHz, Implementation 39, Rev 2.1, 256KB L2, 512KB L3 Cache
6 slot VXR midplane, Version 2.1

Last reset from power-on

PCI bus mb0_mb1 (Slots 0, 1, 3 and 5) has a capacity of 600 bandwidth points.
Current configuration on bus mb0_mb1 has a total of 200 bandwidth points.
This configuration is within the PCI bus capacity and is supported.

PCI bus mb2 (Slots 2, 4, 6) has a capacity of 600 bandwidth points.
Current configuration on bus mb2 has a total of 0 bandwidth points
This configuration is within the PCI bus capacity and is supported.

Please refer to the following document "Cisco 7200 Series Port Adaptor
Hardware Configuration Guidelines" on Cisco.com <http://www.cisco.com>
for c7200 bandwidth points oversubscription and usage guidelines.

1 FastEthernet interface
125K bytes of NVRAM.

65536K bytes of ATA PCMCIA card at slot 0 (Sector size 512 bytes).
8192K bytes of Flash internal SIMM (Sector size 256K).
% Crashinfo may not be recovered at bootflash:crashinfo
% This file system device reports an error

Press RETURN to get started!

*Jan  6 23:23:01.927: %LINEPROTO-5-UPDOWN: Line protocol on Interface VoIP-Null0
, changed state to up
*Jan  6 23:23:01.931: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Jan  6 23:23:03.047: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthern
et0/0, changed state to up
*Jan  6 23:23:03.531: %SYS-5-CONFIG_I: Configured from memory by console
*Jan  6 23:23:03.855: %SYS-5-RESTART: System restarted --
Cisco IOS Software, 7200 Software (C7200-SPSERVICESK9-M), Version 12.4(11)T1, RELEASE SOFTWARE (fc5)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Thu 25-Jan-07 19:57 by prod_rel_team
*Jan  6 23:23:04.183: %SNMP-5-COLDSTART: SNMP agent on host Router is undergoing a cold start
Router>

Our loopback IP address is statically defined on the Windows PC as 10.1.100.20, so we will ping it from the IOS command prompt:

Router>en
Router#sh ip int brief
Interface           IP-Address    OK?    Method    Status    Protocol
FastEthernet0/0     10.1.100.1    YES    NVRAM     up        up
Router#ping 10.1.100.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.100.20, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 28/68/92 ms
Router#

As you can see, we have successfully setup an single virtual router instance using Dynamips and have configured it to successfully communicate to an interface on the host Windows PC.

Author Info:

 
 
Scott's profession is a Senior Network Engineer at a Healthcare transaction company in Franklin, TN. When he is not trying to secure a network or come up with a design for a new project, he enjoys spending time with his family. You can find out more at: http://www.scottp.net

Similar Posts:

 

7 Responses to “Dynamips basics”

  1. Chris B. Says:

    Hello Scott,

    My name is Chris and I’m relatively new to this stuff (not IT, dynamips). I’ve tried a few things with GNS3, but want WIC cards while using an NM-16ESW, and finally figured out that GNS3 doesn’t support WICs, so I decided to dig into dynamips directly. After searching around a bit I found your site and I like it. You start from the ground up, but I had to dig around on the web to find a list of dynamips command line switches so I could figue out what the switches in your example do.

    At any rate, I followed your configuration for the switch; modified the command line for the IOS image I’m using, and got a router running. Also found a good idlepc value so I could use the router (took awhile to figure out that the idlepc switch uses 2 dashes).

    I am unable to ping my loopback adapter and I have a question(s) for you: I don’t see how the Fa 0/0 picked up an IP address in your example. Also, is the switch a virtual device to which you are connecting the router ? If so, what’s the 127.0.0.1 address for ? I think what’s going on is:

    router FA0/0 –> (E0) Virt. switch (E1) –> loopback

    Is this correct ? If so, doesn’t switch E0 need a ‘real’ IP ?

    In my situation, my loopback is configured w/10.10.10.1 and I set Fa 0/0 as 10.10.10.5 (same subnet masks) but it won’t ping.

    Any guidance appreciated!

    Chris

  2. Chris B. Says:

    Hello again Scott,

    Scratch the prvious comment (unless you wish to leave it for clarity).
    While writing, I thought to myself, “why don’t you just try it ?”. I changed the 127.0.0.1 to 10.10.10.3 in the switch config and voila !! I’m able to ping the loopback at 10.10.10.5.

    Thanks for a great beginning with dynamips !

    Chris

  3. Omer Says:

    hi Scott,

    need some help accessing switch using dynagen. i am not able to ssh into the S1 switch from dynagen. when i type telnet S1 it wont start putty for my session. but when i telnet into the R1 it starts the putty session. could you please help me starting the switch any help will greatly be appreciated as i am writing CCNA exam in next couple of weeks

  4. suryantofang Says:

    Hi Scott,

    Nice article, btw is that possible to emulate wireless lab in dynamips + dynagen ?, need your opinion.

    Thanks,

    suryantofang

  5. Munir Says:

    hello sir,
    i am using dynamips i read you comments but one of my question is where to create switch.cfg and where i will save it

  6. Introduction to the dynamips hypervisor | xpresslearn.com Says:

    [...] a previous article titled Dynamips basics, we configured a single router lab that communicated with a loopback adapter on the host Operating [...]

  7. Ankur Says:

    Hi Scott,

    Nice article, btw is that possible to telnet hypervisor so that I can start/stop a router from remotely. As of now I can be able to access Routers via Terminal server; But if i need to reboot my router then, RDP is the only option for me. It would be better if can telnet to hypervisor and can be able to take control of routers remotely, need your opinion.

    Thanks,

Leave a Reply