In a previous article titled Dynamips basics, we configured a single router lab that communicated with a loopback adapter on the host Operating System. The lab was accomplished using nothing but Dynamips (no front ends, configuration help programs, etc…). Before we get into such tools as Dynagen or GNS3, let’s take a look at the Dynamips hypervisor feature.
One of the main purposes of the hypervisor is to provide a communication channel for distributing labs across multiple machines. The hypervisor can be thought of as the server side of a client/server operation. The hypervisor provides a ’supervisor’ like function for telling the dynamips instances what to do. A hypervisor can talk to other hypervisor’s for communicating across distributed hardware.
The popular Dynagen project provides a configuration front end for Dynamips. It allows you to use text based configuration files that defines Dynamips networks. Dynagen works by taking a properly written configuration file and translates that into the appropriate Dynamips commands, that are much harder to understand. Dynagen then talks to a hypervisor instance to send the translated commands to Dynamips. This article will explain how to manually send commands to a Dynamips hypervisor instance, just like what Dynagen would do.
The first thing needed is to start a Dynamips hypervisor instance. This is done by opening a command prompt and switching to the Dynamips directory. Start the hypervisor by typing the following command:
C:\dynamips>start /belownormal /B /wait dynamips-wxp.exe -H 7200

The command does the following:
- Starts dynamips-wxp.exe (Dynamips) in the current command window using the belownormal priority class
- The -H option tells it to operate as a hypervisor instance
- The hypervisor will receive commands on port 7200
Once the hypervisor is started, you can telnet to localhost on port 7200. Open a separate window and issue the command: telnet localhost 7200 . If preferred, any telnet program can be used to make the connection to the hypervisor. Once connected to the hypervisor instance, there won’t initially be anything echoed to the terminal screen. In order to test the connection, issue the following command inside the telnet window (your typing won’t echo back to the screen on this initial command).
hypervisor version (press enter)
If operating properly, you will receive a response containing the version of Dynamips that is running
100-0.2.8-RC1-x86
The 100 in the response is a (successful) return code, with the command results following immediately after the dash following the return code. In this case, the version is 0.2.8 Release Candidate 1, compiled for the x86 platform.
If an invalid command is sent to the hypervisor, a different response code will be returned along with an explanation:
200-At least a module and a command must be specified
To get started, clear the hypervisor to make sure you are starting with a clean slate.
hypervisor reset
100-OK
Next, set the working directory that will contain the router virtual disk images and other files that are created to hold things like the contents of NVRAM, etc.
hypervisor working_dir “C:/Documents and Settings/Administrator/My Documents/dynamips/workdir”
100-OK
Create a 7200 virtual router instance and call it R1
vm create R1 0 c7200
100-VM ‘R1′ created
Make the console port of R1 available on TCP port 2000:
vm set_con_tcp_port R1 2000
100-OK
Set the amount of RAM for R1 to 160Mb:
vm set_ram R1 160
100-OK
The Network Processing Engine (NPE) for the 7200 router called R1 will be a model npe-400:
c7200 set_npe R1 npe-400
100-OK
Set the IOS image for the 7200 virtual router called R1 to boot:
vm set_ios R1 “C:\Documents and Settings\Administrator\My Documents\dynamips\ios\c7200-spservicesk9-mz.124-11.T1.image”
100-IOS image set for ‘R1′
Don’t use the sparse memory option for R1:
vm set_sparse_mem R1 0
100-OK
vm set_blk_direct_jump R1 0
100-OK
Create a virtual switch (called S1) to allow communication between the router Ethernet interface and the a pc interface just as if they both were connected to a real switch:
ethsw create S1
100-ETHSW ‘S1′ created
Add a PA-2FE-TX Port Adapter in slot1 of R1:
vm slot_add_binding R1 1 0 PA-2FE-TX
100-OK
Create a communication channel called nio_udp0 that listens for traffic on port 10000 and connects to the remote port 10001 on localhost to send traffic:
nio create_udp nio_udp0 10000 127.0.0.1 10001
100-NIO ‘nio_udp0′ created
Create a communication channel called nio_udp1 that listens for traffic on port 10001 and connects to the remote port 10000 on locahost to send traffic:
nio create_udp nio_udp1 10001 127.0.0.1 10000
100-NIO ‘nio_udp1′ created
Bind the interface in Slot 1 Port 0 (Interface Fa1/0) on R1 to the nio_udp0 communication channel:
vm slot_add_nio_binding R1 1 0 nio_udp0
100-OK
Connect the virtual switch S1 with the nio_udp1 communication channel:
ethsw add_nio S1 nio_udp1
100-NIO ‘nio_udp1′ bound.
Set the nio_udp1 interface on virtual switch S1 to vlan 1:
ethsw set_access_port S1 nio_udp1 1
100-Port settings OK
Create an interface called nio_gen_eth0 and associate it with a Windows interface on the host machine:
nio create_gen_eth nio_gen_eth0 \Device\NPF_{6BEED806-4E3F-41F9-A5E6-9E558ECFB2E3}
100-NIO ‘nio_gen_eth0′ created
Connect the Windows network interface to S1
ethsw add_nio S1 nio_gen_eth0
100-NIO ‘nio_gen_eth0′ bound.
Set the port connected to nio_gen_eth0 in virtual switch S1 to vlan 1
ethsw set_access_port S1 nio_gen_eth0 1
100-Port settings OK
Set the idle pc value for the image R1 is running to prevent 100% cpu usage
vm set_idle_pc R1 0×60791304
100-OK
Boot the virtual router instance named R1
vm start R1
100-VM ‘R1′ started
Once the instance has been started, telnet to the console port of the router R1 by telneting to localhost on port 2000.
Connected to Dynamips VM “R1″ (ID 0, type c7200) - Console port
R1#sh ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 unassigned YES NVRAM administratively down down FastEthernet1/0 10.1.100.1 YES NVRAM up up FastEthernet1/1 unassigned YES NVRAM administratively down down
R1#sh hardware 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 ROM: ROMMON Emulation Microcode BOOTLDR: 7200 Software (C7200-SPSERVICESK9-M), Version 12.4(11)T1, RELEASE SOFTW ARE (fc5) R1 uptime is 0 minutes System returned to ROM by unknown reload cause - suspect boot_data[BOOT_COUNT] 0 x0, BOOT_COUNT 0, BOOTDATA 19 System image file is "tftp://255.255.255.255/unknown" 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 147456K/16384K bytes of memor y. Processor board ID 4294967295 R7000 CPU at 150MHz, Implementation 39, Rev 2.1, 256KB L2 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 600 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. 3 FastEthernet interfaces 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). Configuration register is 0x2102 R1#


Print This Post
June 17th, 2008 at 11:09 am
I have recently installed GNS3 0.5. I still can’t console into the pix emulator irrespective of the image I use. I have no trouble with the routers, just the firewall. I have followed the tutorial but I cannot figure it out. Can you help?
June 25th, 2008 at 7:06 pm
The firewall hardware is being emulated by Pemu, the hypervisor just ties all the interfaces together so the emulated devices can communicate with each other. First you need to make sure the firewall image is actually booting successfully in pemu and go forward from there. Let me know if your still stuck…
August 13th, 2008 at 5:37 am
hi scott, real great tutorial here, i have always used gns3 and dynagen and in the that spirit have made a few live cds having dynamips, dynagen and gns3 preinstalled, the latest cd i made was only 29.3 mb with dynamips and dynagen. Now on a learning curve i was trying to make a bash/gtkdialog program which would replicate the working of dynagen and “try” to emulate gns3, have been currently able to make a script which can just start of 3-4 routers in the hypervisor mode, ( i just started learning bash - have no programming experience ) , what i cant seem to figure out/google is how do i interconnet, say the ethernet ports of two routers in hypervisor mode, and also get the idlepc option when running in only hypervisor mode. any help would be appreciated
August 13th, 2008 at 6:49 am
ok is it , in the same manner that i connect to the switch , then do i need to create udp channels for each one? oh my!.
August 14th, 2008 at 9:32 pm
Allan,
Sounds like a great idea for a follow up article. Stay tuned - it should be the next one to get published.
Scott
August 17th, 2008 at 10:50 pm
hey great , ill be waiting