Dynamips: cheap cisco hardware

Some days ago, I was facing a migration problem… I had to find a temporary solution to host a Cisco VPN on a fast line where I can’t place a physical Cisco device…

I searched google to see if there were some opensource solution for such VPN server.. But apparently, there is not..

Then I found Dynamips, an IOS software emulator. After reading some docs about it and talking with friends, I decided to give it a try.

You will find hereunder the results of my testings..

First, I got the dynamips package installed on a dedicated server, so a 100mbps will be behind my new “Cisco” device.. Then I had to find an IOS binary image.. Easy, I currently own the physical cisco router that I would emule: I get the same IOS that I was already using.

Finally, it was easy as hell, first, uncompress the IOS image:

# unzip c1700-adventerprisek9-mz.124-13b.bin 

Then, I made a little script to load dynamips on a single CPU:

#!/bin/bash taskset -c 0 dynamips --idle-pc=0x8061e3c0 \ ./c1700 -P 1700 -t 1710 -r 192 -X --sparse-mem \ -s 0:0:linux_eth:eth0 \ -p 0:WIC-1ENET -s 0:1:linux_eth:br0 

What are thoses arguments ?

  • taskset -c 0 — Tells the program that follows to only use the CPU with id 0
  • –idle-pc : This value, dependant of which IOS version you are using, is very handy: it permit the IOS not to take too much CPU usage even when the router is idling, I will show you later on how to find this value yourself..
  • -P 1700 : Tell dynamips to emulate a Cisco 1700 series
  • -t 1710: I needed a 1710 router exactly.
  • -r 192 : How much ram to use ?
  • -X : tells dynamips not to use a separate file for the ram usage. (faster)
  • –sparse-mem : The ram, if not used by the router can be used by the host system.
  • -s 0:0:linux_eth:eth0 : Define that the interface 0:0 of the router should use the linux ethernet named eth0
  • -p 0:WIC-1ENET : As the c1710 router got a free slot, you can use it to place, for this example, an additional network card.
  • -s 0:1:linux_eth:br0 : we tell the additionnal network card that it should use the linux ethernet named br0

Run your script and you are set. you will find after the router has started, the router prompt: Just start to configure it.

Some things to remember:

  • Specify MAC address manually inside your router interface, as the router generate dynamics MAC at router’s boot.
   interface fa0 mac address XX:XX:XX:XX:XX
  • Always compute your idle-pc value for your IOS version: otherwise the router will take you your whole CPU usage..
This entry was posted in Networking. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *