http://subnettingmadeeasy.blogspot.cz/2009/06/index.html
For some time now I have been asked how I simulate hosts in GNS3 and my stock answer was to configure a router as a host by issuing the „no ip routing“ command and setting a default gateway with the „ip default-gateway“ command. You would also need to assign an IP address to the interface connected to the router performing routing, or a switch which in turn is connected to a router doing the routing. It worked a treat but had one major flaw, namely, CPU overhead.
I know that a lot of people tried putting loopback adapters at either end of a topology but when pinging between multiple loopback adapters the traffic stayed on the PC and would not pass through the routers configured in GNS3.
By jove though, a clever man, mirnshi I believe his name is, has devised a great little program that can simluate up to 9 hosts within GNS3. It is called VPCS and can be downloaded from here.
In my traditional style I shall run you through a step-by-step guide of configuring VPCS and show you an example of how I set up a basic topology to test the functionality.
1. Download the zip file from here and extract it to wherever desired.
2. Go to the GNS3/Dynamips directory and rename the cygwin1.dll file to cygwin1.dll.old and copy the cygwin1.dll file in the VPCS directory to this directory.
3. Open up a command prompt and change the directory to where you have the VPCS folder. If you are unsure of how to do this, go to Start–>Run and type in „cmd“ (without the quotes) and hit Enter. Now using Windows Explorer go to the folder where VPCS is located and copy the location from the address bar. If you cannot see the address bar go to View–>Toolbars and click Address Bar. Now go back to the command prompt you opened and type „cd“ (again, without the quotes) followed by the path to your VPCS folder. For example, I may have cd C:Program FilesGNS3vpcs-0.14g
An even easier way to do this in Windows XP is to download the „Open Command Prompt Here“ Power Toy from here.
Once installed right-click the VPCS folder and select Open Command Prompt Here and a command prompt window will open in that directory. Windows Vista includes this ability right out of the box, it’s just not immediately obvious, because it’s hidden behind a shortcut key. To activate this, just hold down the Shift key when you right-click on a folder, and you should see the Open Command Window Here menu item.
4. To run VPCS type vpcs.exe from the command line and you ought to see a screenshot similar to below:
5. Type in the show command to view a printout of your virtual PCs.
6. To view the help type ?
I don’t know who Mike Muuss is by the way, lol.
7. To change the IP address and default gateway to better suit your needs the following syntax prevails:
ip [ip address of PC] [ip address of default gateway] [mask in number of bits]
For example:
8. To change the virtual PC you are configuring simply enter the number of the virtual PC you wish to configure.
9. Keep adding as many PCs as you need and configure the IP addresses as desired (limited to 9).
10. Make a note of the LPORT and RPORT settings (from the show command) for each PC you have configured as you will need them for later.
Now the proof of the pudding is in the eating so what I’m going to do is connect a very simple network in GNS3 (I know this seems obvious but KEEP VPCS RUNNING):
NOTE: Each PC is a separate cloud.
11. Right-click on each cloud, choose Configure and then select the NIO UDP tab. You should now see a screen similar to the following:
12. Referring to step 10 where you noted the LPORT and RPORT values for each PC you need to add the RPORT value to the Local Port field in GNS3, the IP address 127.0.0.1 in the Remote Host field in GNS3, and finally the LPORT value in the Remote Port field in GNS3. Once you have finished this ensure that you click on the Add button and select Apply, then OK. For example if my LPORT value was 20000 and my RPORT value 30000 then I would fill it out thus:
13. Now connect your network in GNS3 end-to-end and assign IP addresses as apt to the routers. Remember to either run a routing protcol between the two routers or use static or default routes. For my purpose I used default routes on each router pointing to the other router.
For example in my IP addressing scheme I have:
PC1 to R1 Fa0/0 = 192.168.1.1/24 and 192.168.1.254/24 respectively
R1 Fa0/1 to R2 Fa0/1 = 192.168.0.1/24 and 192.168.0.2/24 respectively
R2 Fa0/0 to PC2 = 192.168.2.254/24 and 192.168.2.1/24 respectively
My default routes are:
R1: ip route 0.0.0.0 0.0.0.0 192.168.0.2
R2: ip route 0.0.0.0 0.0.0.0 192.168.0.1
My network looks like this now:
14. Go back to VPCS. Here I have tested for end-to-end connectivity by pinging from PC1 to PC2:
„So what?“ I hear you cry. I know this doesn’t prove whether the traffic passes over the GNS3 routers. That is where we use the tracert command in VPCS. Check it out:
Would you look at that! Hop 2 is the Fa0/1 interface of R2. Proof that the packets traverse the routers.
I must say that this is a major breakthrough for me and hopefully for others and will save a lot of time and CPU resources.