Networking with Virtual Cisco Routers on vSphere

By | March 28, 2014



When I build an environment in my lab I need it to be as close to production reality as it can be.  When I am at a client I need to be certain of how the compute, network, and storage resources are going to interact. From a compute perspective this is easy to simulate in a  lab environment. vSphere was made to do it. Things get trickier when trying to test storage and even more so with network hardware.

Storage has become easier in the last couple years with several Virtual Appliances available from EMC, NetApp, HP, and IBM that emulate their hardware cousins rather well. Block can still be an issue and FiberChannel is right out, but you can get pretty close.

Network is another story. Their are plenty of great free virtual appliances and programs that allow you setup complex routed networks in a virtual lab. The problem is that my clients don’t use these in production. Ever. I would hazard a guess that 90% of my clients run Cisco gear. With the Nexus 1K switching is taken care of, but what about routers?

With a little ingenuity and I’ve solve this problem. Although not quite them same, I’ve managed to create a virtual machine to simulate one of the routers I see often, the Cisco 3725.

How It Works

GNS3 is a useful app that folks studying for Cisco certifications have used for years to create simulated networks to practice labs. It is a graphical front end that runs a program called Dynamips that emulates Cisco hardware and can run certain IOS images. When installed on Linux, Dynamips also has a hypervisor mode that can be managed with another program called Dynagen allowing you to run a headless virtual IOS image.

Dynamips also allows you to bind Linux ethernet interfaces directly to the IOS image. This is key.

By running a Dynamips and a Cisco 3725 IOS image on a virtual machine with multiple NICs and Ubuntu Server 12.04 LTS you are able to simulate the real thing. You can telnet to the console of the router, configure as normal, connect the vNICs to multiple virtual networks and presto you are now able to use all the advanced Cisco features in your virtual lab.

The Base Virtual Machine

Create a VM with this hardware configuration:


Network Adapter 1 will be associated to the IP of the underlying Ubuntu server as well as the console port of the Router. Adapters 2,3,4 and 5 will be bound to FastEthernet 0/0,0/1, 1/0, and 2/0 of the Router, respectively. This will result in simulating a router that has 4 ethernet ports, 2 onboard, and 2 1-port NM-1FE-TX Network Modules.

Install Ubuntu Server 12.04 LTS 64-bit. Add the SSH Server package during the install and assign a static IP to eth0.  Accept most all the other defaults unless you decide otherwise.

Power on the machine when the install is complete.

We are now ready to build the router.

Note: I have no desire to receive a Cease and Desist order from Cisco so you will need to find a way to provide your own IOS image. The configuration here has been tested with c3725-adventerprisek9-mz.124-15.T8.image.

Building a Virtual Cisco 3725 Router

1. Connect to the Ubuntu VM via SSH.

2. Create the directory /opt/dynamips.

sudo mkdir /opt/dynamips


3. Change Directory to /opt/dynamips.

cd /opt/dynamics


4. Change the permissions on /opts/dynamips.

sudo chmod -R 755 /opt/dynamips


5. Download the dynagen package.

sudo wget ''


6. Uncompress the package.

sudo tar -xzf download


7. Download dynamips.

sudo wget


8. Change permissions on dynamips.

sudo chmod 755 dynamips-0.2.8-RC2-amd64.bin


9. Change Directory to /usr/bin.

cd /usr/bin


10. Create a symbolic link for dynamips.

sudo ln -s /opt/dynamips/dynamips-0.2.8-RC2-amd64.bin dynamips


11. Create a symbolic link for dynagen and update the link database.

sudo ln -s /opt/dynamips/dynagen-0.11.0/dynagen dynagen


12. Create the following directories in /opt/dynamips: images, working, and vmware

sudo mkdir /opt/dynamips/images

sudo mkdir /opt/dynamips/working

sudo mkdir /opt/dynamips/vmware


13. Download this file:

14. Extract the archive.

15. Upload your Cisco IOS image and the 4 files from the archive to the guest VM using WinSCP.


16. Copy the image to the folder /opt/dynamips/images.

sudo cp imagename /opt/dynamips/images


17. Change Directory to /opt/dynamips/vmware and create a sub-directory named initial.configs

cd /opt/dynamips/vmware

sudo mkdir ./initial.configs


18. Copy the 2 config files to /opt/dynamips/vmware/initial.config

cd ~

sudo cp R1.initial.config.* /opt/dynamips/vmware/initial.configs/


19. Copy to /opt/dynamips/vmware

sudo cp /opt/dynamips/vmware/


20. Bring interfaces eth1, eth2, eth3, and eth4 up.

 sudo ifconfig eth1 up

sudo ifconfig eth2 up

sudo ifconfig eth3 up

sudo ifconfig eth4 up


21. Run ~/



22. This will launch the Dynagen management console and start the Router. Wait a few minutes for the Router to boot. The CPU will spike. This is normal.

23. To calm the CPU down run idlepc get R1

idlepc get R1


24. Enter the number of the line that has an asterix.


25. Save the value to the database.

idlepc save R1 db


26. Restart the Router.

stop R1

start R1


27. Wait for the Router to boot. The CPU should not spike this time.

28. Now open a telnet session in the client of your choice. The IP address, port 2001 assigned to eth0 will be the console port.


You now have a fully functional 4 port Cisco 3725 router running as a guest in vSphere. Configure it just as you would on a physical 3725.

Connect VMs to the networks you create on the Router and use the Router’s ports on the network as the default gateway. Traffic should route as expected.

22 thoughts on “Networking with Virtual Cisco Routers on vSphere

  1. Pingback: vDynamips - Cisco IOS Hypervisor Virtual Appliance |

  2. Pingback: #vBrownBag Follow-Up Virtual Network Lab Setup with Byron Schaller (@byronschaller)

  3. Amith

    Thank you !! I have thought of it sometime back, whether its possible? You did it with ease. Very well explained. Thanks again!!!

  4. mitsos

    It seems very useful and thanks for the detailed guide. However although I could easily connect to the telnet console, when I am trying to ping another host in the same network, ping fails. And I have tested that the eth interface mappings are ok..

    1. Thomas G. Johannesen

      Did you solved this ??

      Im having the same problem

      1. itguy79

        one step is missing from the instructions above.
        The Vmware port groups you create need to be in promiscuous mode. you can overwrite the default vswitch setting in the security tab of the protgroup, otherwise no traffic will pass through to the vmware connected clients.

  5. Raúl Fernández

    Hi, can you send me the file the link is broken .

    an a good post

  6. Ayoub Ayoub


    Very Good Post..thank you !

    But can you send me the file the link is broken !!!

  7. ogd

    Hi, these links seem to be broken as well. Would we be able to get them? Thanks!

  8. bernardino farinha

    Hi, these links seem to be broken as well. Would we be able to get them? Thanks!

  9. Model BoY

    Dear sir when we reboot the router the configs disappear. It shows default configs. Please help me for this issue..

    1. itguy79

      To enable the router config to save after reboot

      1. edit /opt/dynamips/vmware/
      2. comment out the cnfg line to prevent default config from loading on startup.
      3. reload router.
      4. after you make config changes in IOS, run
      # wr
      # copy run start
      5. if step 4 dont work, then on the dynagen console
      => save R1
      => reload R1

      answer yes to load config.

  10. Model BoY

    What can i do now ???

    Rack1R1#show flash:
    %Device ‘flash:’ is in REMOVED state
    %Error show flash: (No device available)


    1. itguy79

      you need to add a flash disk.
      1. edit /opt/dynamips/vmware/
      2. add a value other than 0 to disk0 or disk1 line. 32 or 64 is a good value.
      3. reboot router.
      4. when flash drive is now detected. erase flash
      5. format flash.
      6. show flash:

      See forum link here for example.

    1. itguy79

      hope you’ve resolved this.
      If you did not make this script executable (chmod +x then you need to put “sh” at the front of the command to pass the shell interpreter.

  11. Veselin Chekuhchev

    Very good article! I had stuck on step 13, when I tried to download the (Error (509) This account’s public links are generating too much traffic and have been temporarily disabled!)

    Could you renew the link, please?

    Thanks you!

  12. Chris Ismail

    Can I install any other Cisco routers on the on the cloud? Like Cisco 3845?

  13. Todd Slovisky

    The links to download the files are dead again, Can you email them to me?
    I would really like to get this going it looks like a fun project to mess around with.
    REally looking forward to your reply.

  14. amit

    [email protected]:~$ ~/
    dynamips: no process found
    sudo: unable to execute /usr/bin/dynagen: No such file or directory
    [email protected]:~$ Cisco Router Simulation Platform (version 0.2.8-RC2-amd64)
    Copyright (c) 2005-2007 Christophe Fillot.
    Build date: Oct 14 2007 10:46:52

    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).

    not loading after that. I do have check the directory & symbolic links


Leave a Reply

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