Welcome

First of all, may I welcome you to my site. My name is Chris and I'm from the UK and work as a Systems Engineer for Cisco. This blog was initially created to post up my subnetting technique but has now got more stuff to do with attaining Cisco certifications. Either way I really hope that the content is sufficent for your needs and I look forward to hearing your feedback. If you find that the content really helps you please feel free to donate using the PayPal link on the right.

To view the index of all my articles please click here.

Adding Hosts/PCs to GNS3 - VPCS Configuration Guide

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 Files\GNS3\vpcs-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.

Enjoy!

Chris

Posted byChris Bloomfield at 11:09  

36 comments:

Michael said... 11 June 2008 at 17:55  

Thanks for making this GNS3 experience so easy for me. Adding a Host! wow, now I'm really going through these labs. Thanks again!

nyon said... 22 July 2008 at 21:33  

hey,thanks for this blog, it has helped me a lot.

I´m having problems setting up hosts, when i try to ping a router from vpcs it says it's unreacheable, i´ve checked and double checked the IPs and the subnets, and they are all fine in the router, and in vpcs, any ideias?

Chris Bloomfield said... 22 July 2008 at 21:36  

Hi Nyon,

What is configured in VPCS and on your routers?

nyon said... 22 July 2008 at 22:38  

http://i5.photobucket.com/albums/y175/nyonix/Diagram1.jpg

Here you can see that i´ve setup vpcs for vpcs 3, so can link it to R3Branch

http://i5.photobucket.com/albums/y175/nyonix/diagram2.jpg

in this one, you can see how Fa1/0 and Pc3 cloud is setup.

i think everything is in order.

Other than this i have a loopback NIC setup for ISP, Switches 1,2 and 3 still need setup, so does Cloud PC1 and PC2.

Chris Bloomfield said... 23 July 2008 at 19:22  

Have you tried tracert on VPCS to see where the packets are going? Remember to limit the number of hops to 10 or so otherwise you will be there for ages.

Ayman Najjar said... 6 August 2008 at 07:47  

This IS a major breakthrough !! Thanks a lot..
I used to hook VMWare virtual machines to my GNS3 lab with a simple Linux OS on each one.. But your method is WAY simpler and less resource consuming.

Chris Mendoza said... 10 August 2008 at 03:02  

Hi Chris,

I got confused with the guidelines in step no. 12. At the graphic, did you intentionally incremented the values of Local Port and Remote Port?
Your examples are 20000 and 30000 but you entered 20001 and 300001 is that really how it should be?

Chris Bloomfield said... 12 August 2008 at 16:07  

Hi Chris,

What's happened here is that I have entered 20000 and 30000 and hit the Apply button. By default GNS3 will then ramp up the port numbers, so don't confuse the left-hand side with the right-hand side.

guardianhm said... 20 November 2008 at 13:12  

Hi!

I get the following error when I try to connect the cloud to a router or switch: "206-unable to create UDP NIO"

Is there anything that I am doing wrongly that is causing this error.

Thanks in advance.

o said... 30 December 2008 at 20:18  
This comment has been removed by the author.
Alexandr said... 30 December 2008 at 20:36  

Swap Remote Port and Local Port.
It will be: RPORT - 20000, LPORT - 30000

Vipin Kumar said... 20 March 2009 at 18:04  

Hi Chris,

I am not able to provide end to end connectivity with VPCS. I have done everything correctly. When i start VPCS.exe it shows can't find DHCP server... is it an issue to not be able to ping the default gateway of any pc

Vipin

darkplayer said... 16 May 2009 at 16:55  

Hey Chris,

I wanted to say thanks for posting this tutorial. After editing a few lines in my .net file, I managed to get GNS3 and VPCS to work.

Giorgio said... 1 June 2009 at 12:25  

I can't thank you enough mate. This is absolutely brilliant.
Cheers!

Tudor said... 15 June 2009 at 01:13  

Mike Muus is the creator of the "PING" program. He passed away in a car crash

Jatin said... 30 June 2009 at 07:37  

Simply Superb. I've been on your websites earlier too but never disappointed. Kudos to your hard work and knowledge.

Jatin

Jatin said... 30 June 2009 at 07:39  
This comment has been removed by the author.
Amruth said... 1 July 2009 at 22:43  

Thanks for great work !!!

tess said... 29 August 2009 at 02:29  

THank You for making work easier,
i was trying to emulate thru VM ware...
Now no needed..
Thanx yaar....

Freeman said... 6 October 2009 at 23:55  

thank you very much chris,

206 - unable to create UDP NIO,
to be able to ping default gateway please check my blog post
http://crazy4tips.blogspot.com/2009/10/crazy-vpcs.html

ash said... 19 October 2009 at 00:16  

Is anyone can post any tipe on what these different serial cards mean, and when we need what, and how to turn a router into a switch...
i am quite confused on when to use which slot and make it work..

thanks a lot...

Rajesh Pillai said... 31 January 2010 at 09:54  

I am using VPCS with Dynamips and have everything setup exactly as it should be. I will post the .net file the startup.vpc to confirm the same. Even now I am unable to ping the gateway from the PC and vice versa. Please help me identify the problem.

Topology is simple:

R2 --- R1 --- R3 (Running EIGRP)
f
| | |

PC2 -- PC1 -- PC3

Rajesh Pillai said... 31 January 2010 at 09:56  

D:\Router Simulation\vpcs-0.16c>vpcs.exe

Welcome to Virtual PC Simulator for dynamips, v0.16c
Dedicated to Daling.
Build time: Mar 12 2009 11:32:18
All rights reserved.

NOTICE: MAY NOT use this software for commercial purposes unless
you get an appropriate commercial license for it.

Please contact me at mirnshi@gmail.com or http://mirnshi.cublog.cn
if you have any questions.

Press '?' to get help.


Executing the startup file

PC1 : 11.11.11.12 255.255.255.0 gateway 11.11.11.11

PC2 : 22.22.22.23 255.255.255.0 gateway 22.22.22.22

PC3 : 33.33.33.34 255.255.255.0 gateway 33.33.33.33

VPCS 3 >s

NAME IP/CIDR GATEWAY MAC LPORT RPORT
PC1 11.11.11.12/24 11.11.11.11 00:50:79:66:68:00 20000 30000
PC2 22.22.22.23/24 22.22.22.22 00:50:79:66:68:01 20001 30001
PC3 33.33.33.34/24 33.33.33.33 00:50:79:66:68:02 20002 30002
PC4 0.0.0.0/0 0.0.0.0 00:50:79:66:68:03 20003 30003
PC5 0.0.0.0/0 0.0.0.0 00:50:79:66:68:04 20004 30004
PC6 0.0.0.0/0 0.0.0.0 00:50:79:66:68:05 20005 30005
PC7 0.0.0.0/0 0.0.0.0 00:50:79:66:68:06 20006 30006
PC8 0.0.0.0/0 0.0.0.0 00:50:79:66:68:07 20007 30007
PC9 0.0.0.0/0 0.0.0.0 00:50:79:66:68:08 20008 30008

VPCS 3 >1
VPCS 1 >ping 11.11.11.12
11.11.11.12 icmp_seq=1 time=0.001 ms
11.11.11.12 icmp_seq=2 time=0.001 ms
11.11.11.12 icmp_seq=3 time=0.001 ms
11.11.11.12 icmp_seq=4 time=0.001 ms
11.11.11.12 icmp_seq=5 time=0.001 ms

VPCS 1 >ping 11.11.11.11
host (11.11.11.11) not reachable

VPCS 1 >2
VPCS 2 >ping 22.22.22.23
22.22.22.23 icmp_seq=1 time=0.001 ms
22.22.22.23 icmp_seq=2 time=0.001 ms
22.22.22.23 icmp_seq=3 time=0.001 ms
22.22.22.23 icmp_seq=4 time=0.001 ms
22.22.22.23 icmp_seq=5 time=0.001 ms

VPCS 2 >ping 22.22.22.22
host (22.22.22.22) not reachable

VPCS 2 >3
VPCS 3 >ping 33.33.33.34
33.33.33.34 icmp_seq=1 time=0.001 ms
33.33.33.34 icmp_seq=2 time=0.001 ms
33.33.33.34 icmp_seq=3 time=0.001 ms
33.33.33.34 icmp_seq=4 time=0.001 ms
33.33.33.34 icmp_seq=5 time=0.001 ms

VPCS 3 >ping 33.33.33.33
host (33.33.33.33) not reachable

VPCS 3 >

Robert said... 9 February 2010 at 09:29  

I have configured 3 computers with VPCS,,,as follows:

NAME IP/CIDR GATEWAY MAC LPORT RPORT
PC1 192.168.0.200/24 192.168.0.240 00:50:79:66:68:00 20000 30000
PC2 192.168.0.201/24 192.168.0.240 00:50:79:66:68:01 20001 30001
PC3 192.168.0.202/24 192.168.0.240 00:50:79:66:68:02 20002 30002

They are connected through two core switches running GLBP. I cannot ping the gateway and tracert shows that packets are not going through the gateway. There is a kind of 'short circuit'.

VPCS 1 >tracert 192.168.0.202
traceroute to 192.168.0.202, 64 hops max
1 192.168.0.202 47.000 ms 47.000 ms 47.000 ms

VPCS 1 >ping 192.168.0.240
host (192.168.0.240) not reachable

I have configured three routers to act as PCs and these work well.

Any ideas? Thank you.

Robert said... 9 February 2010 at 09:29  

I have configured 3 computers with VPCS,,,as follows:

NAME IP/CIDR GATEWAY MAC LPORT RPORT
PC1 192.168.0.200/24 192.168.0.240 00:50:79:66:68:00 20000 30000
PC2 192.168.0.201/24 192.168.0.240 00:50:79:66:68:01 20001 30001
PC3 192.168.0.202/24 192.168.0.240 00:50:79:66:68:02 20002 30002

They are connected through two core switches running GLBP. I cannot ping the gateway and tracert shows that packets are not going through the gateway. There is a kind of 'short circuit'.

VPCS 1 >tracert 192.168.0.202
traceroute to 192.168.0.202, 64 hops max
1 192.168.0.202 47.000 ms 47.000 ms 47.000 ms

VPCS 1 >ping 192.168.0.240
host (192.168.0.240) not reachable

I have configured three routers to act as PCs and these work well.

Any ideas? Thank you.

Chris Bloomfield said... 9 February 2010 at 13:12  

Are you guys using Vista or do you have a firewall in place that could be preventing ICMP?

Robert said... 9 February 2010 at 13:16  

Hi Chris, thanks for your comment. Well I'm using Vista and have a firewall but I have taken all necessary precautions. In fact I am simulating a complex network and as I said if I had to use simple routers instead of the VPCS I'm able to ping.

I know VPCS is running in an out of band fashion from GNS3 but the interesting point is I can ping the other hosts within VPCS but not the gateway. Also tracert shows that the packet is reaching the intended destination but not through the gateway 192.168.0.240.

Ronak Bhatt as Rocky said... 16 October 2010 at 00:36  

Hi I am using GNS3 for MAC on my MACBOOK and want to add hosts to my labs. Can you show me the steps to add that? Thank You.

Steven said... 7 April 2011 at 04:10  

I cannot figure this out. Can you tell me where I am having problems with my static routing?


r1 connects to r2 via with 0.0.0.0 0.0.0.0 s0/0/0
r3 connects to r2 via with 0.0.0.0 0.0.0.0 s0/0/1
r2 connects to ISP

pc connected to r1 can ping r2
pc connected to r3 can ping r2

I cannot ping r3 from r1 or ISP. Can you tell me what is wrong with my static routes? I know that is my problem with r2.

r2's running-config

# interface FastEthernet0/1
ip address 10.10.20.1 255.255.255.252
duplex auto
speed auto
!
interface Serial0/0/0
ip address 172.19.0.2 255.255.255.252
!
interface Serial0/0/1
ip address 172.19.0.6 255.255.255.252
clock rate 56000
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 172.17.0.0 255.255.0.0 Serial0/0/0
ip route 172.18.0.0 255.255.0.0 Serial0/0/1
!
!

Chris Bloomfield said... 12 April 2011 at 07:49  

Hi,

Without seeing the full config it is hard to know what the cause may be. You're best bet is to use "debug ip icmp" on R3 to see if it is even receiving the echo messages and whether it is sending an echo reply.

Regards,

Chris

Kiwi Chirs said... 19 February 2012 at 01:43  

Excellent, I'm loving it. Thank you for publishing this.

About Me said... 8 October 2012 at 20:05  

Hi Chris,
thanks for this guide, else I wouldn't figure out how to start with GNS3.
Cheers.

ajit peshane said... 9 January 2013 at 21:52  

cool dude u made my day..... thanks a lot chris to get me an idea of vpcs....
I was serching for this from last 7 days and here we go.
I love it and it is totally working... actually i was getting the error like .dll file missing but i have copied vpcs.exe to the C:\Program Files\GNS3 and it starst working....thanks again....

ajit peshane said... 9 January 2013 at 21:54  

thank you sir....!!!!!

Alfan Nasrulloh said... 3 March 2014 at 16:04  

Thank you.. It's very helpful

prasad said... 21 April 2014 at 07:47  

great work and really i got a full info from this post.

Post a Comment