VPCS(1)
π VPCS β Virtual PC Simulator π
okay bestie, welcome to vpcs(1) β that's the manual page for VPCS, the Virtual PC Simulator. it's giving "study buddy for your network labs" and honestly? iconic. let's get into it π«Ά
β¨ SYNOPSIS β¨
vpcs [OPTIONS] [FILENAME]
πΈ DESCRIPTION πΈ
so basically, VPCS hands you a command line interface to nine simulated virtual PCs. you can ping and traceroute from them, to them, and out to other hosts and routers β which makes it the study tool when you're simulating Cisco or Juniper routers in a Dynamips or GNS3 environment. periodt. π
these virtual PCs can generate and respond to ICMP (ping), TCP and UDP packets, and those packets get delivered to the application through either a UDP pipe or a Unix tap interface. your choice, your vibe.
if scriptfile is specified, then vpcs reads that file on start-up and runs the commands inside it. heads up though β scriptfile must be in vpcs script file format. no random files, bestie, it will not read your grocery list.
here's the networking tea β: vpcs listens for messages on nine consecutive UDP ports and sends messages on nine consecutive UDP ports. by default, it listens on UDP ports 20000 to 20008 and sends on UDP ports 30000 to 30008. each UDP port pair is one virtual PC β 20000/30000, 20001/30001 β¦ all the way to 20008/30008. and the virtual PCs are numbered 1 to 9. cute, right? β¨
π OPTIONS π
-h,--helpβ prints the command line options and then exits. the "wait what were the flags again" button, we love her.-vβ prints the version information and exits.-Rβ disables the relay function.[-i] numβ startvpcswithnumvirtual PCs, maximum 9. if you omit it,vpcsstarts with 9 virtual PCs. and ifnumis1β like when GNS3 v1.x spawns PCs β then commands that reference other PCs get restricted options, and the prompt won't display the PC number.-p portβ runvpcsas a daemon process listening on the TCP port specified byport. as a daemon it gives you no command line interface at all, but you can still reach that CLI remotely with a TCP stream application liketelnetornetcat(nc). > β οΈ real talk: once the daemon has started, there is no internal mechanism for terminating the program. you have to kill it with a system signal9, usually viakill -9 PID(wherePIDis the process id of thevpcsinstance). so like, remember the PID, bestie π-m numβvpcsuses 9 consecutive MAC addresses for the 9 vpcs, starting at00:50:79:66:68:00by default. the-moption addsnumto the last byte of the base MAC address. and if any increment makes that last byte exceed0xFFduring this process, it wraps around to0x00. she's modular, she's efficient π«[-r] FILENAMEβ ifFILENAMEis specified,vpcsreads the file on start-up and executes the commands in it.FILENAMEmust be in vpcs script file format. by default, if a file namedstartup.vpcexists in the directory where thevpcsprogram was started, it'll be read and executed whenvpcsstarts. and fun fact: the-roption is optional ifFILENAMEis the last parameter. lowkey generous of her.-eβ on systems that support the/dev/tapxinterface (Unix/Linux), runvpcsin tap mode instead of UDP mode. in tap mode, IP packets are sent and received via/dev/tapxinterfaces rather than UDP streams. > β οΈ typically/dev/tapxinterfaces are only available to the root user, which meansvpcswould also need to be run by root (sudo vpcs -e) to use tap mode. sudo era π[-u]β this option is the default and not necessary at all, but it's here to contrast with the-eoption. by default,vpcssends and receives IP packets to and from specified UDP ports: it listens on UDP port20000and sends to127.0.0.1:30000by default. and you can manipulate those listening and sending ports using the-s,-cand-toptions. she's the baseline, the blueprint, the default queen π
π¦ UDP Mode Options π¦
-s portβportspecifies the base port number thatvpcsuses to listen for messages. by defaultvpcslistens on UDP ports20000to20008. changing the base port with-smakes it use nine consecutive UDP ports starting at the port you specify.-t ipβvpcsstreams packets to nine UDP ports, starting at127.0.0.1:30000by default. the-toption lets you stream those packets to a remote host specified by IPv4 addressip. typically that remote host is runningdynamipswith a cloud connection configured to link to this host's IP address. long-distance relationship, but make it packets π‘-c portβvpcsstreams packets to nine UDP ports commencing at127.0.0.1:30000. the-coption lets you stream those packets to a different set of nine ports, starting at the base port number specified byport.
π§ TAP Mode Options π§
-d deviceβ device name. works only when-iis set to1. that's the whole rule, don't fight it π
π Hypervisor Mode Option π
-H portβ run as a hypervisor, listening on the TCP port specified byport. in hypervisor mode you can connect this control port withtelnetand start or stop an instance ofvpcs. main character energy fr fr.
π EXAMPLES π
π No command line options
if you start vpcs with no arguments, it starts up and looks for the script startup.vpc in the current directory. if that file exists, it runs the script. this is the normal way of running vpcs β just evoke it from the command line like this:
vpcs
π Starting vpcs with an alternative startup file
to start vpcs with a startup script file called, say, alternate.vpc, just use the file name as an argument to the vpcs command:
vpcs alternate.vpc
π Running more than nine Virtual PCs
so suppose you need more than nine Virtual PCs β you'd want to run a second instance of vpcs on your local host. before you do, consider:
- the VPCs MAC addresses for the second instance would need to be different.
- the "local" or listening UDP port numbers for the second instance would have to differ from the first instance.
- 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'd want to start vpcs with a local listening port of 20009 (or greater) and a remote port of 30009 (or greater). you'd also want the base MAC address offset by at least nine to avoid any clashes. in that case you'd use the command:
vpcs -s 20009 -c 30009 -m 9
but honestly? a far better way to run more than nine Virtual PCs is to use Hypervisor mode. in Hypervisor mode, vpcs automatically takes care of incrementing MAC addresses and UDP port numbers, so there's no clash. she handles the admin for you, bestie π«Ά
β¨ BASE INTERFACE β¨
okay bestie, so vpcs serves up a command line interface (unless you started it in daemon mode with the -p option). The prompt tells you which of the 9 virtual PCs is currently the main character by showing the VPC number in brackets. Like:
VPCS[1]>
That 1 in the brackets means VPC 1 has focus. Any traffic you make comes from VPC 1, and basic show commands are all about VPC 1. π
Note: If you started with -i 1, then VPC 1 always has focus, and the prompt does not show the VPC number in brackets. Like:
VPCS>
π Basic commands supported are: π
?β Print help πββοΈdigitβ Switch to the VPCdigit.digitrange1to9π’arp [digit|all]β Shortcut for:show arp. Show arp table for VPCdigit(default this VPC) or all VPCs π΅οΈββοΈclear ip|ipv6|arp|neighbor|histβ Clear IPv4/IPv6, arp/neighbor cache, command history π§Ήdhcp [OPTION]β Shortcut for:ip dhcp. Attempt to obtain IPv4 address, mask, gateway and DNS via DHCP π‘disconnectβ Exit the telnet session (daemon mode) πecho TEXTβ DisplayTEXTin output π£οΈhelpβ Print help πhistoryβ Shortcut for:show history. List the command history πip ARG ... [OPTION]β Configure the current VPC's IP settingsARG ...:address [mask] [gateway]address [gateway] [mask]- Set the VPC's ip, default gateway ip and network mask. Default IPv4 mask is
/24, IPv6 is/64. Example:ip 10.1.1.70/26 10.1.1.65sets the VPC's ip to10.1.1.70, the gateway to10.1.1.65, the netmask to255.255.255.192. In tap mode, the ip of thetapxis the maximum host ID of the subnet. In the example above thetapxip would be10.1.1.126.maskmay be written as/26,26or255.255.255.192.
- Set the VPC's ip, default gateway ip and network mask. Default IPv4 mask is
auto- Attempt to obtain IPv6 address, mask and gateway using SLAAC.
dhcp [OPTION]- Attempt to obtain IPv4 address, mask, gateway, DNS via DHCP
OPTION:-dβ Show DHCP packet decode-rβ Renew DHCP lease-xβ Release DHCP lease
dns ip- Set DNS server ip, delete if
ipis'0'
- Set DNS server ip, delete if
domain NAME- Set local domain name to
NAME. The domain name will be added to host names when using commands that support names. Example: If the domain name was set toexample.com, then a command ofping abcdwould cause the VPCS to attempt to resolve the nameabcd.example.com.
- Set local domain name to
load [FILENAME[.vpc]]β Load the configuration/scriptfile from the fileFILENAME. IfFILENAMEends with'.vpc', then the'.vpc'can be omitted. IfFILENAMEis omitted thenstartup.vpcwill be loaded if it exists. When the file is loaded, each line of the file is executed as a VPCS command. If the state of the echo flag is on, the command will be echoed to the console before execution, except:- If the command is prefixed with a
'@'symbol (eg@set echo color red); - If the command is an
echocommand; - If the command is a
sleepcommand
- If the command is prefixed with a
Note: The commandsleep 0will be echoed if the echo flag is on. Seeset echoandshow echo. Note: PressCtrl+Cto interrupt the running script.
ping HOST [OPTION ...]β Ping the networkHOSTwith ICMP (default) or TCP/UDP.HOSTcan be an ip address or name.OPTIONS:-1β ICMP mode, default-2β UDP mode-3β TCP mode-c countβ Packet count, default5-Dβ Set the Don't Fragment bit-f FLAGβ Tcp headerFLAG|C|E|U|A|P|R|S|F| bits |7 6 5 4 3 2 1 0|-i msβ Waitmsmilliseconds between sending each packet-l sizeβ Data size-P protocolβ Use IP protocol in ping packets1- ICMP (default),17- UDP,6- TCP
-p portβ Destination port-s portβ Source port-T ttlβ Set ttl, default64-tβ Send packets until interrupted byCtrl+C-w msβ Waitmsmilliseconds to receive the response
Notes: 1. Using names requires DNS to be set. 2. Use Ctrl+C to stop the command.
quitβ Quit program πͺrelay ARG ...β Configure packet relay between UDP ports. Therelaycommand allows the VPCS to become a virtual patch panel where connections can be dynamically changed using therelaycommand. There are three steps required to use VPCS as a virtual patch panel.- A relay hub port must be defined using the
relay port portcommand. - Remote NIO_UDP connections (cloud connections in GNS3) use this hub port as the remote port, ensuring each NIO_UDP connection has a unique local port. (The local port numbers will be used to 'patch' the connection). VPC instances can be directed to use this hub port as their remote port using the command
set rport port. - The 'patching' is completed using the command:
relay add [ip1:]port1 [ip2:]port2, whereport1andport2are the local port numbers used in step 2.
ARG:add [ip1:]port1 [ip2:]port2β Relay the packets betweenip1andip2del [ip1:]port1 [ip2:]port2β Delete the relay ruledel idβ Delete the relay ruledump [on|off]β Dump relay packets to fileport portβ Set relay hub portshowβ Show the relay rules
- A relay hub port must be defined using the
Note:ip1andip2are127.0.0.1by default
rlogin [ip] portβ Telnet toporton host atip(relative to host PC). To attach to the console of a virtual router running on port2000of this host PC, userlogin 2000. To telnet to the port2004of a remote host10.1.1.1, userlogin 10.1.1.1 2004.save [FILENAME[.vpc]]β Save the configuration to the scriptfileFILENAME.vpc. If there is no'.'inFILENAMEthen a'.vpc'extension is added. IfFILENAMEis omitted then the configuration will be saved tostartup.vpc.set ARG ...β Set hostname, connection port, ipfrag state, dump options and echo optionsARG:dump FLAG [[FLAG]...]β Set the packet dump flags for this VPC.FLAG:allβ All the packets including incoming. must use[detail|mac|raw]as well as'all'detailβ Print protocolfileβ Dump packets to filevpcs[id]_yyyymmddHHMMSS.pcap'offβ Clear all the flagsmacβ Print hardware MAC addressrawβ Print the first 40 bytes
echo on|off|[color clear|FGCOLOR [BGCOLOR]]β Sets the state of the echo flag used when executing script files, or sets the color of text toFGCOLORwith optionalBGCOLOR.set echo color clearresets colors to their defaults. Color list:black,red,green,yellow,blue,magenta,cyan,whitelport portβ Local portmtu valueβ Set the size of the maximum transmission unit of the interfacepcname NAMEβ Set the hostname of the current VPC toNAMErport portβ Remote peer portrhost ipβ Remote peer host IPv4 address
show [ARG ...]β Show information forARGARG:arp [digit|all]β Show arp table for VPCdigitor all VPCsdump [digit|all]β Show dump flags for VPCdigitor all VPCsechoβ Show the status of the echo flag. Seeset echo ?historyβ List the command historyip [digit|all]β Show IPv4 details for VPCdigitor all VPCs. Shows VPC Name, IP address, mask, gateway, DNS, MAC, lport, rhost:rport and MTUipv6 [digit|all]β Show IPv6 details for VPCdigitor all VPCs. Shows VPC Name, IPv6 addresses/mask, gateway, MAC, lport, rhost:rport and MTUversionβ Show the version information
Notes: 1. If no parameter is given, the key information of all VPCs will be displayed. 2. If no parameter is given forarp/dump/ip/ipv6information for the current VPC will be displayed.
sleep [seconds] [text]β Printtextand pause execution of script for timeseconds. Ifsecondsis zero or missing, pause until a key is pressed. Default text when no parameters given:'Press any key to continue'.trace HOST [OPTION ...]β Print the path packets take to the networkHOST.HOSTcan be an ip address or name.OPTIONS:-P protocolβ Use IP protocol in trace packets1- icmp,17- udp (default),6- tcp
-m ttlβ Maximum ttl, default8
Notes: 1. Using names requires DNS to be set. 2. Use Ctrl+C to stop the command.
versionβ Shortcut for:show versionwrite [FILENAME[.vpc]]β Do the same assave
π VPCS script file format π
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. As the script is being executed, the VPCS will either display each command immediately before it is executed or not depending on the state of the echo flag. The @ character can also be used to supress command echoing. Commands pre-pended by the @ character are not echoed. The echo and sleep commands are never echoed except the sleep 0 command which is always echoed.
Command files can make use of the echo and sleep commands to create some form of interactive script.
Script file execution can be aborted at any time by pressing Ctrl+c. This means that the ping HOST -t command (which must be terminated by Ctrl+c) is not useful in vpcs script files.
π¦ HYPERVISOR INTERFACE π¦
Okay so this is the main character mode, bestie. When you start vpcs with the -H port option, it goes full hypervisor mode and runs as a daemon process. It's giving manager energy.
To get into the vpcs hypervisor interface, you open a telnet session to whatever port number you gave the -H option. Like, say you ran vpcs -H 20000 β then you'd normally telnet to port 20000 on your localhost IP address (127.0.0.1). Iconic, right?
In this mode you get a whole different interface so you can create and kill multiple vpcs sessions. Heads up: those sessions are always run as a daemon process, and you have to reach them either through an external telnet app, or by using the telnet or rlogin command from inside the vpcs hypervisor session itself. π«Ά
So in hypervisor mode, here's the command menu, and it's short and sweet:
help|?β Print helpdisconnectβ Exit the telnet sessionlistβ Listvpcsprocess and idsquit [-f]β Stop allvpcsprocesses and hypervisor.-f= force quit without promptingstop idβ Stopvpcsprocess number idrlogin [ip] portβ Same astelnettelnet [ip] portβ Telnet to port at ip (default127.0.0.1)vpcs [parameters]β Startvpcsdaemon with parameters.
A typical hypervisor session might run something like this:
-------------------------------------------------------
~$ vpcs -H 20000
~$ telnet 127.0.0.1 20000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HV > vpcs
100-VPCS started with -p 20001 -s 20000 -c 30000
HV > rlogin 20001
Connect 127.0.0.1:20001, press Ctrl+X to quit
NOTES: you will be back to the starting point, NOT THE LAST,
if using Ctrl+X to quit.
Welcome to Virtual PC Simulator, ... <output omitted> ...
VPCS[1] disconnect
Good-bye
Disconnected from 127.0.0.1:20001
HV >
-------------------------------------------------------
Okay so notice β when the vpcs instance was started from inside the hypervisor interface, it spawned a vpcs daemon process listening on TCP port 20001. To get at that process, the rlogin command was used to port 20001, which kicked off a session with that instance. But ngl you could've just as easily started another independent telnet session in another shell instance to 127.0.0.1 20001. Same vibe, different door. π
Also, when you're done with the vpcs session, you can bounce either with the disconnect command, or with the key combo Ctrl+X. And here's the tea β if you've got nested rlogin sessions, Ctrl+X takes you back to the hypervisor, but disconnect takes you back one level in the nesting. Not the same thing, don't mix them up. π
π BUGS π
- IPv6 implementation is a basic implementation that is not fully implemented.
- The
ping HOST -tcommand (which must be terminated byCtrl+c) can not be used invpcsscript files, because whenCtrl+cis pressed to stop the ping, it also aborts the script file execution. Yeah. That one hurts. π
Please send problems, bugs, questions, desirable enhancements, patches etc to the author. They want the mail, fr fr.
π AUTHOR π
Paul Meng <mirnshi[AT]gmail.com> Documentation by Chris Welsh <rednectar.chris[AT]gmail.com>
πΈ COPYRIGHT πΈ
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.
And that's the whole page, bestie β this was VPCS(1), version 0.8, dated 2013-12-16. Go forth and sim some virtual PCs. Slay. β¨π
π¦ where this page comes from
- nixos 26.05: vpcs 0.8.3
- opensuse-leap 16.0: vpcs 0.8.2-bp160.1.10 Β· BSD-2-Clause
- opensuse-leap 16.0: vpcs 0.8.2-bp160.1.10 Β· BSD-2-Clause
- opensuse-leap 16.0: vpcs 0.8.2-bp160.1.10 Β· BSD-2-Clause
- opensuse-leap 16.0: vpcs 0.8.2-bp160.1.10 Β· BSD-2-Clause
- ubuntu resolute: vpcs 0.8.3-1.1 Β· BSD-2-Clause
- ubuntu stonking: vpcs 0.8.3-1.1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms