VPCS(1) | Virtual PC Simulator | VPCS(1) |
vpcs - Virtual PC Simulator
vpcs [options] [scriptfile]
VPCS provides a command line interface to nine simulated virtual PCs. You can ping/trace route from/to them, or ping/trace route other hosts/routers from the virtual PCs, making it an ideal study tool when you simulate Cisco or Juniper routers in a Dynamips or GNS3 environment.
Virtual PCs are able to generate and respond to ICMP (ping), TCP and UDP packets delivered to the application via a UDP pipe or Unix tap interface. If scriptfile is specified, then vpcs reads the file on start-up and executes the commands in the scriptfile. scriptfile must be in vpcs script file format.
vpcs listens for messages on nine consecutive UDP ports and sends messages on nine consecutive UDP ports. By the default, vpcs listens on UDP ports 20000 to 20008 and sends messages on UDP ports 30000 to 30008. Each UDP port pair (20000/30000, 20001/30001...20008/30008) represents a virtual PC. Virtual PCs are numbered 1 to 9.
If you start the vpcs with no arguments, vpcs will start and look for the script startup.vpc in the current directory. If it exists, it will run the script. This is the normal way of running the vpcs. It is simply envoked from the command line like this:
vpcs
To start vpcs with a startup script file called say alternate.vpc, use the file name as an argument to the vpcs command:
vpcs alternate.vpc
Suppose you needed more than nine Virtual PCs, so you want to run a second instance of vpcs on your local host. You would have to consider:
1. The VPCs MAC addresses for the second instance would need to be different,
2. The "local" or listening UDP port numbers for the second instance would have to differ from the first instance.
3. The remote UDP port numbers for the second instance would have to differ from the first instance.
Since the default local listening port is 20000, and the default remote port is 30000, you would want to start vpcs with a local listening port of 20009 (or greater) and remote port of 30009 (or greater) . You would also want the base MAC address to be offset by at least nine to avoid any clashes. In this case you would use the command:
vpcs -s 20009 -c 30009 -m 9
Suppose you wanted to run a second instance of vpcs on your local host that can communicate with the instance already running with a default configuration. You would have to consider:
1. The VPCs MAC addresses for the second instance would need to be different,
2. The "local" or listening UDP port numbers for the second instance would have to match the "remote" port numbers of the first instance
3. The remote UDP port numbers would have to match the "local" or listening UDP port numbers of the first instance
Since the default local listening port is 20000, and the default remote port is 30000, you would want to start vpcs with a local listening port of 30000 and remote port of 20000. You would also want the base MAC address to be offset by at least nine to avoid any clashes. In this case you would use the command:
vpcs -s 30000 -c 20000 -m 9
vpcs presents the user with a command line interface
(unless daemon mode has been invoked by the -p option). The interface
prompt indicates which of the 9 virtual PCs currently has focus by
indicating the VPC number in brackets. Eg.:
VPCS[1]
Here the digit 1 inside the brackets indcates that VPC 1 has focus, and any
traffic generated will be sent from VPC 1, and basic show commands
will relate to VPC 1.
Any text file consisting of valid vpcs commands can be used as a
vpcs script file. Lines in the file beginning with the # character
will be treated as comments and ignored. Command files can make use of the
echo and sleep commands to create some form of interactive
script.
Script file exececution can be aborted at any time by pressing Ctrl+c. This
means that the ping <host> -t command (which must be terimated
by Ctrl+c) is not useful in vpcs script files.
IPv6 implementation is a basic implementation that is not fully implemented.
The ping <host> -t command (which must be terimated by Ctrl+c) can not be used in vpcs script files because when Ctrl+c is pressed to stop the ping, it also aborts the script file execution.
Please send problems, bugs, questions, desirable enhancements, patches etc to the author.
Paul Meng <mirnshi[AT]gmail.com>
Documentation by Chris Welsh <rednectar.chris[AT]gmail.com>
VPCS is free software, distributed under the terms of the
"BSD" licence.
Source code and license can be found at vpcs.sf.net.
For more information, please visit wiki.freecode.com.cn.
2014-06-28 | 0.5 |