Monday, February 15, 2010

Connecting GNS3 lab to the internet - Lesson1

Connecting GNS3 lab to the internet
Part1. Connecting Cisco router to the internet
Windows7\XP

Hello in this tutorial I will explain how to connect your GNS3 lab to the internet.
The HOWTO contains two parts. First - Connecting Cisco router to the internet. And second - Connecting the emulated network to the internet

In our situation we would connect the whole emulated networks to the internet. To achieve this we will connect one of our routers to the internet and will then use NAT on this router  to allow other emulated networks to get access outside.

My topology will looks like this:
Windows7 - The PC where the GNS3 installed and running
MSLoopback - Microsoft loopback adapter
Router - My real Edimax router
Inetrnet - Real internet


So here are the steps:
1.Create MSLoopback interface
2.Create Cloud connected to MSLoopback interface
3.Create Cisco router and connect it to the cloud
4.Test connectivity

Create MSLoopback interface
Firs off all you`ll need an Loopback adapter thru witch your emulated network will be connected to your computer.


Go to Control Panel >> Device Manager , right click on your computer name at the top of the list and select Add legacy hardware. Wizard window will open.Click NEXT and choice Install the hardware that I manually choice from the list.
Choice Network Adapters and click NEXT.


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.


I have renamed this adapter to HOST to GNS.


Now you need to allow you interface that connected to the internet to be used by other networks. In my case this is wireless adapter that connected to my Edimax router. Right click on it and select Properties, now go to the Sharing tab. Select Allow other network users to connect through this computer`s internet connection: check box, and select the Microsoft Loopback Adapter as it shown on the picture (Remember I have renamed my MSLoobpack to HOST to GNS)


Click next. At this point windows will set the IP of your Microsoft Loopback interface to 192.168.0.1 with 24 network mask.


Create Cloud connected to MSLoopback interface
Open a new GNS3 project. Drag and drop Cloud from the list to the working space. Right click it and select Configure.




In the NIO Ethernet tab select your Microsoft Loopback interface and click on Add button. Click OK. Now you have a cloud connecting your GNS project through the loopback interface to your computer.


Create Cisco router and connect it to the cloud
I will use Cisco 3600 router. Create 2 Fast Ethernet interfaces. Start the router and configure one of the interfaces (I will use FastEthernet 0/0) with IP: 192.168.0.254 /24


Configure default route by entering this command under the EXEC mode:


(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.1


Connect the FastEthernet 0/0 interface to the cloud. 


Test connectivity
At this point you should be able to ping the Microsoft Loopback Interface (192.168.0.1) from the router. Also try to ping your real Router (The default getaway of your computer). And than try to ping  internet addresses. try to ping domain names like google.com


Next Lesson

29 comments:

  1. Nice tutorial!

    Just wanted to make a point, this is called layer 3 bridging instead of 'bridging'. Here loopback is sharing the internet connection with
    physical nic.

    ReplyDelete
  2. I did everything but the loopback interface doesn´t appears in GNS3 cloud configuration..

    Any help?

    ReplyDelete
    Replies
    1. select run as administrator on the gns3 icon

      this will work for you

      Delete
  3. Any Interfaces at all appears in NIO tab?

    ReplyDelete
  4. Yes the interfaces will appear in GNS3 if you run it as administrator. Right-click on GNS3 & select "run as administrator"

    ReplyDelete
  5. Hi, is the following scenario working if i have 3 routers running ospf in which one is connected to the cloud for internet?
    1. i have redistributed static route to ospf but failed to ping internet.!!!!please help!!!!

    ReplyDelete
    Replies
    1. u need to nat them as far as remember:)

      Delete
    2. I have the same problem as bristybilash.

      I can ping the internet from the directly connected router, but not from the other routers.

      I am running frame relay with ospf, and have applied the ospf command "default-information originate always" to the directly connected router to propagate the route.

      I can see that the route is propagated through the entire network, as such:

      O*E2 0.0.0.0/0 [110/1] via 10.255.3.2, 00:07:57, Serial1/0.301

      However, I cannot reach the internet from the other routers.

      A traceroute shows the following:

      BR2#traceroute 192.168.0.1

      Type escape sequence to abort.
      Tracing the route to 192.168.0.1

      1 10.255.3.2 16 msec 24 msec 16 msec
      2 * * *
      3 * * *
      4 * * *

      Can someone please assist?

      Delete
    3. Answered my own question.

      The actual issue is that the host has no knowledge of the GNS3 internal network. As a result, only the boundary router can ping the internet, as the host's routing table DOES have a route to the loopback created on the host that is in use by GNS3.

      The solution is to use static routes on the host, or NAT on the GNS3 boundary router as stated above.

      I configured PAT as I had multiple "inside" links on the same router - worked perfectly. All routers could successfully ping 4.2.2.2.

      Delete
  6. NiceT
    www.furniture-victory.co.il , tryed my web,aster skills :)

    ReplyDelete
  7. http://www.furniture-victory.co.il tryed my webmaster skills

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. FYI, windows 7 uses 192.168.137.1/24 for its ICS address and I had to reboot several times for this to work..

    ReplyDelete
  10. How do I creat a MSloopback on a window XP machine?

    ReplyDelete
  11. thanks for posting this. I'm having a little trouble understanding a couple things about setting up the correct subnet though.

    what is your "real" networks ip setup like?

    ie: is your real life router 192.168.1.1

    ReplyDelete
  12. What terrible English!

    ReplyDelete
  13. it works by connecting gns3 to my default gateway. if I try to ping an address from the internet it is unrichable...

    ReplyDelete
  14. "Anonymouse said -
    I did everything but the loopback interface doesn´t appears in GNS3 cloud configuration..."

    type in run box: HDWWIZ and then the wizzard for adding hardware will start. success!

    ReplyDelete
  15. I followed the above steps and at first, the MS loopback was not appearing in the dropdown box. I closed GNS3 and re-opened with admin privs and had the same issue. So I rebooted win 7 and it worked fine afterwards.

    in win 7, MS loopback does get 192.168.137.1/24.

    Also, once I set the ip on the router side (.5), it's not able to ping the MS loopback, but I can ping the real internet traffic and my real external network through the wlan.

    thanks for the post!

    ReplyDelete
  16. excellent explanation thanks... for those who did not manage to get it worked try to restart the computer and try it again, should work.

    ReplyDelete
  17. guys if it is not working you may need to enable network sharing so that internet can be forwarded to the MS-loopback.
    after that it surely should work.

    ReplyDelete
    Replies
    1. the ms-loopback will ofcourse have its ip address changed to 192.168.0.1 for windows xp users

      Delete
  18. I just installed GNS3 in mi windows 7 but when i try to configure the cloud there is no Generic Ethernet NIO in the list, i runned it as administrator.

    Please help me!!

    ReplyDelete
  19. My Qemu in GNS 3 are not working properly it ping some time but some time can not what is the main problem

    ReplyDelete
  20. Hai I am using windows 7,i have configured loopback and default route but ,i cant ping even to ip of network adapter loopback,
    !
    interface FastEthernet1/0
    ip address 192.168.10.3 255.255.255.0
    ip route 0.0.0.0 0.0.0.0 FastEthernet1/0.
    this is what i configured in router,

    I have already changed my loopback adapter's ipv4 to 192.168.10.1

    but i cannot ping t0 192.168.10.1 from router


    ReplyDelete
  21. https://www.youtube.com/watch?v=apKJF9ugMAM

    Watch this video it will clear your doubts

    ReplyDelete
  22. sirs,
    I wll be gladfull that if somedbody may help to solve my problem.
    My problem is i have cisc1700 and i am using this cisco router connecting to another cisco 1700 in gns3 and i am also connecting to loopback adaptor network by giving a different ip address. In total i am using two router and one Pc. For that i can able to ping to the PC from the second router but i cannot ping to Second router from the PC. so what is the problem?
    thanks

    ReplyDelete