How To Setup a Cisco CME (Cisco Manager Express) Virtual Router under Linux using dynamips and dynagen

1.) Install dynagen and dynamips

2.)Also configure your bridge or br0

If you don't have a br0 on your Linux machine then follow this guide or video for Debian:

Alternatively you can use NIO_linux_eth:eth0 for f0/0 below but remember the host machine cannot talk to the router then.

3.)Create your dynagen config

Save the file below to something.conf


#Example config:

autostart = False
[127.0.0.1:2000]
workingdir = /home/mint/router
udp = 10100
[[7200]]
image = c7200-adventerprisek9-mz.151-4.M.bin
disk0 = 256
#idlepc = 0x60be916c
[[ROUTER r1]]
model = 7200
console = 2521
aux = 2119
#wic0/0 = WIC-1T
#wic0/1 = WIC-1T
#wic0/2 = WIC-1T

#instead youcould use f0/0=NIO_linux_eth:eth0 but your host would not have communication with the router


f0/0 = nio_tap:tap1
x = 22.0
y = -351.0

4.) Start dynamips

sudo dynamips -H 2000&

5.) Start your router

dynagen yourconffromstep3.conf

6.) Connect to your router and configure

telnet localhost 2521

enable
conf t
int fa0/0
ip address 192.168.5.1 255.255.255.0
no shut

7.) Test connectivity

Make sure you put your tap1 on the bridge and put up tap1. After this you should be able to ping your router but remember your host's br0:0 should be created and be on the same subnet to work.

sudo brctl addif br0 tap1

sudo ifconfig tap1 up

Performance Tuning

I recommend you set calculate and set idlepc, as a wrong value or no value will guarantee it will use at least ~100% of the CPUcore dynamips is on. Check this guide here to set idlepc for dynamips with dynagen

Helpful Dynagen and Dynamips Startup Script

This script as it is will get your r1 and r2 router up without typing any commands. All you have to do is change the .conf file name to your own and make sure to save the contents of the script to an "something.sh", chmod +x something.sh and then ./something.sh and it will automatically get you going. It also kills any other instances of dynamips or dynagen to avoid conflicts. The only thing it does need is sudo so it will ask for your sudo password.

Remember that you need "expect" installed or this script will not work (use apt install expect or yum install expect).


The script makes a few assumptions but you can of course change it.

1.) Dynamips is to be started on port 2000 if not change it!

2.) That you want to create two tap devices "tap1" and "tap2" and add them to your bridge br0

3.)It also assumes you are in the directory of "yourconffile.conf" in bold in the script below. Change that name to the name of yours

4.) Finally it also assumes that you have routers r1 and r2 that you want to be started automatically in the send "start r1\n" area. You can add more lines for more routers or change the names according to your needs.

#!/bin/bash
sudo killall dynamips dynagen
sudo dynamips -H 2000 &

sudo ip tuntap add tap1 mode tap
sudo ip tuntap add tap2 mode tap
sudo brctl addif br0 tap1
sudo brctl addif br0 tap2

sudo ifconfig tap1 up
sudo ifconfig tap2 up

expect <(cat <<'EOD'
spawn dynagen yourconffile.conf
expect "Dynagen management console for Dynamips"
send "start r1\n"
send "start r2\n"
interact
exit
EOD
)


Tags:

cisco, cme, virtual, router, linux, dynamips, dynagenexample, config, autostart, workingdir, mint, udp, adventerprisek, mz, bin, disk, idlepc, console, aux, wic, nio_tap,

Latest Articles

  • Huion and Wacom Tablets How To Install in Linux Mint / Ubuntu and make the stylus work properly
  • ffmpeg how to cut certain parts of video out
  • ffmpeg how to concat and join two video clips
  • mencoder instead of ffmpeg to join or concatenate video files with different audio streams
  • Linux How To Stop Missing Drive from Halting Boot Process in fstab
  • How To Replace Audio Track of Video using ffmpeg
  • qemu-img convert formats vdi vmdk raw qcow2
  • Linux and Windows Dual Boot Crazy Time Issues
  • dynagen / dynamips 100% high CPU usage solution - how to set the idlepc value
  • How To Setup a Cisco CME (Cisco Manager Express) Virtual Router under Linux using dynamips and dynagen
  • Linux Mint Ubuntu Debian CentOS Dual Boot Install Issues
  • Linux Mint Ubuntu Debian Centos RHEL no sound solution
  • Linux Mint/Debian/Ubuntu/Centos Installer black grub screen and blank screen after trying to boot installer or main OS
  • Linux Mint Dual Boot Install Avoid Wiping our your Main C: drive /dev/sda MBR and EFI
  • QEMU-KVM soundhw deprecated how to enable sound in QEMU 4.x series
  • Virtualbox Error Cannot register the hard disk because a hard disk with UUID already exists solution
  • kernel: [549267.368859] mate-terminal[7871]: segfault at 2000000101 ip 00007f5d0a9548f0 sp 00007fff7012c610 error 4 in libgobject-2.0.so.0.4800.2[7f5d0a920000+52000]
  • apcupsd how to setup and monitor APC UPS units
  • How To Password Reset, Recover, Bypass, Remove and Unlock on Windows 10,8,7,Vista,XP,NT,2000,2003,2008,2012,2016,2019 Administrative Login Programs
  • Nvidia Ubuntu Linux Screentearing Video with solution driver