VPCS for Dynamips 9 PCs support

download:http://www.freecode.com.cn/doku.php?id=wiki:vpcs

 

 Usage

vpcs
 [options]
-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 [CIDR] [gateway] 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 IPv4 CIDR
is 24, IPv6 is 64. '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 netmask to 255.255.255.192, the
tapx ip to 10.1.1.126 (ether mode).
dhcp Configure host/gateway address using DHCP.
arp Show arp table.
ping address Ping the network host.
echo address port [udp|tcp] Echo the host port with protocol(udp/tcp).
tracert address [maxhops] Print the route packets take to network host.
default maxhops is 16.
conf [lport|rport] port Set local or remote port. 'conf lport' will close
the old port and open the new port. Only udp mode.
? Print help.
quit Close all the port(udp mode) or the tapx (ether
mode), then quit.
Do you remember Mr. Mike Muuss?
 VPCS
 1 >s
NAME IP/CIDR GATEWAY MAC LPORT RPORT
PC1 172.16.1.1/24 172.16.1.10 00:50:79:66:68:00 20000 30000
2001:1::10/64
PC2 192.168.100.2/24 192.168.100.1 00:50:79:66:68:01 20001 30001
PC3 172.16.3.3/24 172.16.3.10 00:50:79:66:68:02 20002 30002
PC4 192.168.4.4/24 192.168.4.10 00:50:79:66:68:03 20003 30003
2001:4::10/64
PC5 0.0.0.0/0 0.0.0.0 00:50:79:66:68:04 20004 30004
PC6 0.0.0.0/0 0.0.0.0 00:50:79:66:68:05 20005 30005
PC7 0.0.0.0/0 0.0.0.0 00:50:79:66:68:06 20006 30006
PC8 0.0.0.0/0 0.0.0.0 00:50:79:66:68:07 20007 30007
PC9 0.0.0.0/0 0.0.0.0 00:50:79:66:68:08 20008 30008

If in the ether mode, please run it before the dynamips loads/starts the ios.

When VPCS started, it listens the ports from 20000 to 20008 and wait the dymamips to connet, and send the packets to the ports from 30000 to 30008 which should be listened by the Dynamips.

VPCS looks for the file named 'startup.vpc' in the current directory, and execute the commands in it if you are not set the startup file from the command line. All the commands in the startup file are the internal command of the VPCS . The line started with '#' or '!' will be discarded.

 # The startup file of VPCS

#
# pc1, ipv4 & ipv6
1
ip 172.16.1.1 172.16.1.10 24
ip 2001:1::10 64
# pc2, using dhcp
2
dhcp
# pc3, ipv4
3
ip 172.16.3.3 172.16.3.10 24
# pc4, ipv4 & ipv6
4
ip 192.168.4.4 192.168.4.10 24
ip 2001:4::10 64
# switch to PC1
1

.net file (ether mode), please refer to dynagen for details.

 # VLAN lab
ghostios = True
sparsemem = True
[localhost]
[[ROUTER sw]]
model = 2621
image = /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
image = /ios.run/c2600-i-mz.123-6c.bin
ram = 32
slot1 = NM-1FE-TX
f0/0 = NIO_linux_eth:tap2

.bat (udp mode)

  dynamips-wxp.exe -i R1 -T 2000 -P 2600 -r 64 -c 0x2142 -p 1:NM-16ESW 
-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

Dynamips loads ios with NM-16ESW module in slot 1, and listens 30000 to 30002. NM-16ESW is 16 port switch module (from f1/0 to f1/15). '-s 1:0:udp:30000:127.0.0.1:20000' means:

  1. this is port 0
2. dynamips (or ios) sends the packets from port 30000 to port 20000 which listens by VPCS (PC1).
3. VPCS (PC1) sends the packets from port 20000 to dynamips.

.net file (udp mode)

 # VLAN lab
ghostios = True
sparsemem = True
[localhost]
[[ROUTER sw]]
model = 2621
image = /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 = 0x805785a0
[[router r1]]
model = 2621
image = /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 = 0x804f4044

Note

  • To make compatible with the dynamips, VPCS does NOT use the cygwin1.dll released by cygwin.com. DO NOT use the file releases by cygwin.com, and keep the LATEST cygwin1.dll in the your PC.
  • 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.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值