Pages

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 :
 cygwin1.dll  
 filelist.txt  
 readme_cn.txt  
 readme.txt  
 startup.vpc  
 vpcs32    <- (for 32-bit linux systems)  
 vpcs64    <- (for 64-bit linux systems)  
 vpcs.exe  
 vpcs.hist  
 vpcs.osx  

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  
 VPCS[9]>   

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

 VPCS[1]> ip 192.168.100.1 192.168.100.254 24  
 PC1 : 192.168.100.1 255.255.255.0 gateway 192.168.100.254  

To view a PC’s IP or MAC address.
I added IP addresses for the other VPCS as well.
 VPCS[9]> show  
 NAME  IP/CIDR       GATEWAY      MAC        LPORT RPORT  
 VPCS1 192.168.100.1/24   192.168.100.254  00:50:79:66:68:00 20000 30000  
     fe80::250:79ff:fe66:6800/64  
 VPCS2 192.168.100.2/24   192.168.100.254  00:50:79:66:68:01 20001 30001  
     fe80::250:79ff:fe66:6801/64  
 VPCS3 192.168.100.3/24   192.168.100.254  00:50:79:66:68:02 20002 30002  
     fe80::250:79ff:fe66:6802/64  
 VPCS4 192.168.100.4/24   192.168.100.254  00:50:79:66:68:03 20003 30003  
     fe80::250:79ff:fe66:6803/64  
 VPCS5 192.168.100.5/24   192.168.100.254  00:50:79:66:68:04 20004 30004  
     fe80::250:79ff:fe66:6804/64  
 VPCS6 192.168.100.6/24   192.168.100.254  00:50:79:66:68:05 20005 30005  
     fe80::250:79ff:fe66:6805/64  
 VPCS7 192.168.100.7/24   192.168.100.254  00:50:79:66:68:06 20006 30006  
     fe80::250:79ff:fe66:6806/64  
 VPCS8 192.168.100.8/24   192.168.100.254  00:50:79:66:68:07 20007 30007  
     fe80::250:79ff:fe66:6807/64  
 VPCS9 192.168.100.9/24   192.168.100.254  00:50:79:66:68:08 20008 30008  
     fe80::250:79ff:fe66:6808/64  

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: 127.0.0.1Remote 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: 127.0.0.1
Remote port: 20001

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

Assign the following settings to C4 (corresponding to VPCS4) :
Local port: 30003
Remote host: 127.0.0.1
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 αλλά για όλες τις διανομές. Χρησιμοποιεί και ελάχιστη μνήμη!