Connect GNS3 to the internet


Hi All!

I have not create any new posts for a while now and it is because my CCIE R&S lab exam in Belgium is approaching really fast in exactly 68 days and I must admit I have never studied harder probably in  my entire life !

I have been using this set up for a few months and it is great for instance if your doing NAT or QOS cause you can literally see how the traffic is classified , you can shape it , police it using legacy and MQC QOS techniques and basically you can practice tons of things with it and it’s really simple to set up.

In order to connect your GNS3 network to the internet you have to do the following :

1- Build your network

gns3_internet

2- Go to command prompt CMD and type “hdwwiz.exe” and hit enter

3- Wizard window will open. Click NEXT and choice Install the hardware that I manually choice from the list.

4- Choice Network Adapters and click NEXT.
5- Choice Microsoft category from the list at the left side of the windows and than Microsoft Loopback Adapter. Click next. After installing a new adapter will appear at your network devices window
6- Now you need to allow your PC  interface that connects to the internet to be used by other networks. I use wireless adapter to connect to the internet so simply go to your Network Connections , select the adapter you use to connect to the internet , Right click on it and select Properties, now go to the Sharing tab.
gns3_internet1
7-Select Allow other network users to connect through this computer`s internet connection: check box, and select the previously created Microsoft Loopback Adapter as it shown on the picture (mine is called Local Area Connection 2)
gns3_internet2
You have just shared your real internet connection adapter with your created loopback so all you have to do now is go back to your GNS3 and associate your loopback with the GNS3 cloud.
BTW IP address should automatically be generated to this loopback by your real internet adapter. In my case it is  192.168.137.1 /24
gns3_internet3
Go to your GNS3 router and give it an ip address from the same subnet , I’ve assigned 192.168.37.10 255.255.255.0
gns3_internet4
You also need to create a default static route as you would normally do in the real world on a perimeter of your network pointing to the clouds (loopback) ip address which essentially from now is acting like an ISP
gns3_internet5
and that’s all !
From the router you should now be able to ping whatever it is out that is pingable 🙂 , let say global DNS ? or bbc.co.uk or google etc …..
gns3_internet6
You need to enable ip domain-lookup to get DNS name resolved.
Great thing about this set up is that you build your network behind R1 in our case , connect few more router , switches , VM and , practise NAT , NTP  , Routing Protocols (if your home router support them) and many more.
I personally use this sort of gns3-internet connectivity mostly for QOS , shaping , policing and other congestion avoidance and management techniques because once you configure for instance MQC shaping on R1 F0/0 or policing on F0/1 and start doing some file transfers from your VM etc you can clearly see and manipulate traffic differently and to have even more fun you can involve your home router and configure QOS on it if of course it supports it ….
One more thing , every device which is behind R1 (to the left) in our topology in order to get out to the internet you will need to configure NAT on R1 so let’s say if our N1 machine was a windows XP VM , you will have to configure static , overload , pool or whatever NAT you fancy in order for it to access any websites out there , and then you add some QOS and police HTTP traffic from this VM and the fun begins all over again 🙂
Enjoy !
Tom
Advertisements

About ccie4all
Hello, and welcome to the first post of my CCIE blog This blog has got one simple goal and that is to improve our skills in Cisco Networking field so we can become best engineers on a job market. Wordpress Blog https://ccie4all.wordpress.com/ information about the changes made to Gns3 BGP , MPLS and R&S CCIE labs. In order to access and download all provided materials and receive important updates from Gns3 BGP , MPLS and R&S CCIE labs under GNS3 tab in the main header please go ahead and subscribe to https://ccie4all.wordpress.com/ ! All other posts have not been affected and can be accessed at any given time. Enjoy ! Tom

11 Responses to Connect GNS3 to the internet

  1. raipraveen83 says:

    Tom Sorry friend i disturb you in the middle of your lab prep…but thanks again for your effort and only have one query …i try PAT on R1 but i don’t know why its not work but when i did static NAT and Bind LAN IP with 192.168.137.0 pool ip then it work could you pls tell why PAT not work…second if i am tryin to ping from my LAPTOP to Gns3 router its also not ping do i need NAT for outside as well………

    • ccie4all says:

      Hello Raipraveen83,

      No problem at all! PAT uses unique source port numbers on the Inside Global IP address to distinguish between translations so it could be something to do with returing traffic from the internet to your LAN , could you post the PAT config so I can take a look ?

      As it is a P2P connection between your laptop card and the router you then should be able to ping between these devices and if you only can from you PC NIC to a GNS3 Router that only tells one thing , firewall is blocking the connection. When you load your GNS3 IOS and console to your router you can ping it from your PC because there is no firewall coded into Cisco IOS by default unless you configure it CBAC, ZBF etc … For instance when you use ASA for the same you will not be able to ping it unless you allow icmp via ACL beforehand.

      The same applies here , windows by default will block ICMP which is the reason why you can only ping from “IT” back to back to “IT”. Go into your PC control panel, windows firewall , and allow ICMP in the inbound acl rules.

      Best
      Tom

  2. AA says:

    In the newest version of GNS3, it is fairly easy to configure a router for Internet access (no need for loopback adapter necessarily). However, after configuring the Internet access, I was left wondering … why do I need Internet access in GNS3 lab/study environment? Could you help identify some of the good use case, any topology for studies where Internet access could be utilized?

    • trunkwo says:

      There are many reasons why you would want to try this. For example, you can safely see if a default route is being propagated through a lab, or, for the purposes of CCNP, you can see if a default route is being originated correctly.

  3. Sumit Bhardwaj says:

    I followed all the steps give above but still i am unable to ping my laptop loopback 192.168.137.1 with my R1 router 192.168.137.10 please help me as soon as possible because i have to submit my collage project.

    • ccie4all says:

      Most probably Windows firewall on your PC is blocking ICMP
      Temporarily disable your firewall and if the ping started working then you will need to allow ICMP inbound on your PC depending on a firewall you use

  4. Sumit Bhardwaj says:

    sorry but still its not working

  5. Sumit Bhardwaj says:

    i have to submit a major project based on networking will you please guide me that what i have to prepare.

    • ccie4all says:

      Because this is a very simple set up with direct P2P links (no vlans or other filtering in between) that requires very minimum amount of configuration firewall is practically the only device/software that could be causing it
      Start checking from the basics IP Addressing , Subnet Mask etc …and again double check your windows firewall configuration depending on what software you’re using

  6. Sumit Bhardwaj says:

    ok please tell me after configuring ip addressing what about natting i have to do that natting with my wireless ip or with my virtual adapter ip

  7. Sumit Bhardwaj says:

    thanks sir i done that thanks a lot.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: