Saturday, October 29, 2011

Add hosts in GNS3 using VPCS on Ubuntu

The Virtual PC Simulator (VPCS) is a program that runs within Windows or Linux. It has limited functionality, but it allows pings and traceroutes. if you want to save memory and CPU cycles , VPCS is the application to go.
The VPCS can simulate up to 9 PCs.

When VPCS starts, it listens the ports from 20000 to 20008 and waits the
dynamips to connect, and sends the packets to the ports from 30000 to 30008.

More info in the GNS3 website here. From the official website go here.

1. Download VPCS 
use this link here

2. Unzip and change permission

Unzip to any directory will give you :
 vpcs32    <- (for 32-bit linux systems)  
 vpcs64    <- (for 64-bit linux systems)  

Depending on your operating system - mine is 32 bits - select the appropriate file

Change permissions to executable and you get
 -rwxr-xr-x 1 vpcs32  

3. Create Application Launcher

Type: Application in Terminal
Name: VPCS
Command : [point to the vpcs file you have selected in previous step]

4. Start VPCS

Best to start it before GNS3
Click the VPCS icon

  VPCS[1]> ?  
 show            Print the net configuration of PCs  
 d             Switch to the PC[d], d is digit, range 1 to 9  
 history          List the command history  
 ip [arguments]       Configure PC's IP settings  
 dhcp            Configure host/gateway address using DHCP  
 arp            Show arp table  
 ping address [options]   Ping the network host  
 tracert address [maxhops] Print the route packets take to network host  
 echo [text]        Display text in output  
 clear [arguments]     Clear ip/ipv6, arp/neighbor cache  
 set [arguments]      Set hostname, connection port and echo on or off  
 load filename       Load the configuration/script from the file 'filename'  
 save filename       Save the configuration to the file 'filename'  
 ver            Show version  
 ?             Print help  
 quit            Quit program  

Type a number to switch to another PC. 
 VPCS[1]> 2  
 VPCS[2]> 3  
 VPCS[3]> 4  
 VPCS[4]> 5  
 VPCS[5]> 6  
 VPCS[6]> 7  
 VPCS[7]> 8  
 VPCS[8]> 9  

To assign an IP address, subnet mask, and default gateway to a PC
IP address :
Subnetmask : /24
Gateway :

 VPCS[1]> ip 24  
 PC1 : gateway  

To view a PC’s IP or MAC address.
I added IP addresses for the other VPCS as well.
 VPCS[9]> show  
 VPCS1  00:50:79:66:68:00 20000 30000  
 VPCS2  00:50:79:66:68:01 20001 30001  
 VPCS3  00:50:79:66:68:02 20002 30002  
 VPCS4  00:50:79:66:68:03 20003 30003  
 VPCS5  00:50:79:66:68:04 20004 30004  
 VPCS6  00:50:79:66:68:05 20005 30005  
 VPCS7  00:50:79:66:68:06 20006 30006  
 VPCS8  00:50:79:66:68:07 20007 30007  
 VPCS9  00:50:79:66:68:08 20008 30008  

Notice the last two columns with the  local and remote ports

5. Integrate VPCS in GNS3

Start GNS3, goto Edit and the to Symbol Manager

From Available Symbols select computer
Move symbol to customize nodes

Name Box : Computer
Type : Cloud

In the GNS3 Nodes Types column, you should now see the newly added computer icon.
Goto to main workspace and drag/drop four Computers using the icon created above along with a router and a switch

Now we need to configure each icon to match the local and remote hosts based on the VPCS application we run previously
Right-click on C1 and choose Configure. Click on C1 under Clouds. Click the NIO UDP tab.
Type in the following values under Settings:
Local port: 30000
Remote host: port: 20000
These settings correspond to VPCS 1. 
Click the Add button and then OK.

Assign the following settings to C2 (corresponding to VPCS2) :
Local port: 30001
Remote host:
Remote port: 20001

Assign the following settings to C3 (corresponding to VPCS3) :
Local port: 30002
Remote host:
Remote port: 20002

Assign the following settings to C4 (corresponding to VPCS4) :
Local port: 30003
Remote host:
Remote port: 20003

6. Test it
I created a setup with four virtual PCs a switch and a router.
See the topology below along with the ping results 

You may edit the startup.vpc file according to your needs and load the configuration file for all the virtual PCs

1 comment:

Anonymous said...

Σε ευχαριστώ. Πολύ καλός οδηγός και όχι μόνο για Ubuntu αλλά για όλες τις διανομές. Χρησιμοποιεί και ελάχιστη μνήμη!