使用VPC在dynamips环境中模拟PC
September 3, 2007 – 1:21 pm | by admin 本文被查看1,099 次The VPCS can simulate up to 9 PCs. You can ping/traceroute them, or ping/traceroute the other hosts/routers from the virtual PCs when you study the Cisco routers in the Dynamips. VPCS is not the traditional PC, it is just a program running on the Linux or Windows, and only few network commands can be used in it. But VPCS can give you a big hand when you study the Cisco devices in the Dynamips. VPCS can replace the routers or VMware boxes which are used as PCs in the Dynamips network.
-u udp mode, default
-e tap mode, using /dev/tapx
-s port local udp port, default from 20000
-c port remote udp port(dynamips udp ports), default from 30000
-r file run startup file VPCS 1 >?
show Print the net configuration of PCs.
d Switch to the PC[d], d is digit, range 1 to 9.
hist List the history command, use arrow keys to get
recently-executed commands.
ip address gateway [CIDR] Set the host’s ip, gateway’s ip and network mask.
In the ether mode, the ip of the tapx is the maximum
host ID of the subnet. Default CIDR is 24.
ip 10.1.1.70 10.1.1.65 26
set the host ip to 10.1.1.70,
the gateway ip to 10.1.1.65,
the tapx ip is 10.1.1.126,
the netmask is 255.255.255.192.
ping address Ping the network host.
tracert address [maxhops] Print the route packets take to network host.
default maxhops is 64.
conf [lport|rport] port Set local or remote port in the udp mode. ‘conf lport’
will close the previous port and reopen the local port.
? Print help.
quit Quit and close all the port(udp mode) or the tapx(ether mode). Do you remember Mr. Mike Muuss?If in the ether mode, please run it before the dynamips loads/starts the ios.
#
1
ip 172.16.1.1 172.16.1.10 24
2
ip 172.16.1.2 172.16.1.10 24
3
ip 172.16.1.3 172.16.1.10 24
# switch to PC1
1.net file (ether mode), please refer to dynagen for details.
ghostios = True
sparsemem = True
[localhost]
`ROUTER sw`
model = 2621
p_w_picpath = /ios.run/c2600-ipbase-mz.123-8.T.bin
ram = 128
slot1 = NM-16ESW
f1/0 = r1 f0/1
f1/1 = NIO_linux_eth:tap0
f1/2 = NIO_linux_eth:tap1
`router r1`
model = 2621
p_w_picpath = /ios.run/c2600-i-mz.123-6c.bin
ram = 32
slot1 = NM-1FE-TX
f0/0 = NIO_linux_eth:tap2.bat (udp mode)
-s 1:0:udp:30000:127.0.0.1:20000
-s 1:1:udp:30001:127.0.0.1:20001
-s 1:2:udp:30002:127.0.0.1:20002 ..\ios.run\c2600-te.bin.net file (udp mode)
ghostios = True
sparsemem = True
[localhost]
`ROUTER sw`
model = 2621
p_w_picpath = /ios.run/c2600-ipbase-mz.123-8.T.bin
ram = 128
slot1 = NM-16ESW
f1/0 = r1 f0/1
f1/1 = NIO_udp:30000:127.0.0.1:20000
f1/2 = NIO_udp:30001:127.0.0.1:20001
idlepc = 0×805785a0
`router r1`
model = 2621
p_w_picpath = /ios.run/c2600-i-mz.123-6c.bin
ram = 32
slot1 = NM-1FE-TX
f0/0 = NIO_udp:30002:127.0.0.1:20002
idlepc = 0×804f4044 NOte
You should run VPCS before starting the dynamips while using ether mode. VPCS opens the tap interfaces. And you should know, VPCS will CLOSE the tap interfaces before quit.
ChangeLog
1. add ping/tracert local host
2. fix a ping bug, can get echo reply from a non-exist host ipversion 0.12
1. fix the ‘tracert’ argument bugversion 0.11
1. replace a static arrayversion 0.10
1. add udp mode
2. can be run on the windows platform
3. support CIDRversion 0.02
1. Fixed a bug about the history commands