Setup Dynamips/Dynagen Router Emulation Environment on Ubuntu Linux
Saturday, 10. March 2007, 04:57:00
2.
mkdir dynamips mv dynamips-0.2.5-x86.bin /opt/dynamips mv dynagen-0.9.0.tar.gz /opt/dynamips cd /opt/dynamips; tar zxvf dynagen-0.9.0.tar.gz ; ln -s dynagen-0.9.0 dynagen
In following text, if full path is not specified, /opt/dynamips is the start point.
3. Set up environment variables
Add the following lines into ~/.bash_profile
export PATH=$PATH:/opt/dynamips:/opt/dynamips/dynagen
4.(optional) Configure dynagen
Since my X setting is a bit messed I cannot use xterm because of "X locale not supported" and "Cannot open input method". As a result I have to find an alternative.
sudo apt-get install rxvt
Edit dynagen/dynagen.ini, jump to the following lines:
# Uncomment below for Linux telnet = xterm -T %d -e telnet %h %p > /dev/null 2>&1 &
Modify the second line to:
telnet =rxvt -T %d -e telnet %h %p > /dev/null 2>&1 &
5. Dowload an IOS image. Below is a possible site:
http://www.cublog.cn/u/17982/showart.php?id=221235
mkdir ios mv unzip-c7200-is-mz.122-37.bin ios
6. Configure a dynagen topology.
mkdir labini; cd labini touch ccnp_mini.net
Edit the text file ccnp_mini.net, add following contents (make usre to give image attribute a valid path):
autostart = False
[localhost]
port = 7200
udp = 10000
[[router R1]]
image = ../ios/unzip-c7200-is-mz.122-37.bin
model = 7200
console = 3001
npe = npe-400
ram = 60
confreg = 0x2102
exec_area = 64
mmap = False
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
slot2 = PA-A1
f0/0 = SW1 1
s1/1 = R2 s1/0
s1/2 = FR1 1
a2/0 = AT1 1
[[router R2]]
image = ../ios/unzip-c7200-is-mz.122-37.bin
model = 7200
console = 3002
npe = npe-400
ram = 60
confreg = 0x2102
exec_area = 64
mmap = False
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
f0/0 = SW1 2
s1/1 = R3 s1/0
s1/2 = FR1 2
[[router R3]]
image = ../ios/unzip-c7200-is-mz.122-37.bin
model = 7200
console = 3003
npe = npe-400
ram = 60
confreg = 0x2102
exec_area = 64
mmap = False
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
f0/0 = SW1 3
s1/1 = R4 s1/0
s1/2 = FR1 3
[[router R4]]
image = ../ios/unzip-c7200-is-mz.122-37.bin
model = 7200
console = 3004
npe = npe-400
ram = 60
confreg = 0x2102
exec_area = 64
mmap = False
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
f0/0 = SW1 4
s1/1 = R5 s1/0
s1/2 = FR1 4
[[router R5]]
image = ../ios/unzip-c7200-is-mz.122-37.bin
model = 7200
console = 3005
npe = npe-400
ram = 60
confreg = 0x2102
exec_area = 64
mmap = False
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
f0/0 = SW1 5
s1/1 = R6 s1/0
s1/2 = FR1 5
[[router R6]]
image = ../ios/unzip-c7200-is-mz.122-37.bin
model = 7200
console = 3006
npe = npe-400
ram = 60
confreg = 0x2102
exec_area = 64
mmap = False
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
f0/0 = SW1 6
s1/1 = R7 s1/0
s1/2 = FR1 6
[[router R7]]
image = ../ios/unzip-c7200-is-mz.122-37.bin
model = 7200
console = 3007
npe = npe-400
ram = 60
confreg = 0x2102
exec_area = 64
mmap = False
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
f0/0 = SW1 7
s1/1 = R8 s1/0
s1/2 = FR1 7
[[router R8]]
image = ../ios/unzip-c7200-is-mz.122-37.bin
model = 7200
console = 3008
npe = npe-400
ram = 60
confreg = 0x2102
exec_area = 64
mmap = False
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
slot2 = PA-A1
f0/0 = SW1 8
s1/2 = FR1 8
a2/0 = AT1 2
[[ATMSW AT1]]
1:1:100 = 2:2:200
[[ethsw SW1]]
1 = dot1q 1
2 = dot1q 1
3 = dot1q 1
4 = dot1q 1
5 = dot1q 1
6 = dot1q 1
7 = dot1q 1
8 = dot1q 1
[[FRSW FR1]]
1:102 = 2:201
1:103 = 3:301
1:104 = 4:401
1:105 = 5:501
1:106 = 6:601
1:107 = 7:701
1:108 = 8:801
2:203 = 3:302
2:204 = 4:402
2:205 = 5:502
2:206 = 6:602
2:207 = 7:702
2:208 = 8:802
3:304 = 4:403
3:305 = 5:503
3:306 = 6:603
3:307 = 7:703
3:308 = 8:803
4:405 = 5:504
4:406 = 6:604
4:407 = 7:704
4:408 = 8:804
5:506 = 6:605
5:507 = 7:705
5:508 = 8:805
6:607 = 7:706
6:608 = 8:806
7:708 = 8:807
Below is the topology depicted in the following figure:
7. Run an emulation.
In a gnome-terminal tab, execute
dynamips -H 7200
In another tab, execute
dynagen /opt/dynamips/labini/ccnp_mini.net
The output in the console may be like:
Reading configuration file... Network successfully started Dynagen management console for Dynamips =>
8. Continue running
=> list Name Type State Server Console R1 7200 stopped localhost:7200 3001 R2 7200 stopped localhost:7200 3002 R3 7200 stopped localhost:7200 3003 R4 7200 stopped localhost:7200 3004 R5 7200 stopped localhost:7200 3005 R6 7200 stopped localhost:7200 3006 R7 7200 stopped localhost:7200 3007 R8 7200 stopped localhost:7200 3008 FR1 FRSW n/a localhost:7200 n/a AT1 ATMSW n/a localhost:7200 n/a SW1 ETHSW n/a localhost:7200 n/a
Start a router and connect to it
=> start R1 100-C7200 'R1' started => telnet R1 =>
Now you'll see a new rxvt window. That's the telnet session for router R1.










anzah # 10. March 2007, 12:06