Connect GNS3 router to Internet via Physical network adapter



LAB diagram

Step 1: Create a loop back interface. Open run and type hdwwiz.exe to open the “Add New Hardware Wizard”





Next



Select Install the hardware that I manually. Next
Slect Network Adapter. Next
Slect Microsoft/Microsoft Loopback Adapter. Next
Click Finish



Step2: Enable Internet connection in physical network adapter

Go to Start -> Control Panel -> Network and Internet -> Network Sharing Center, from the left pane click “Network Connections”, right-click your internet connection select properties and go to the sharing tab
Slect  Allow other network uses to connect through this computer's Inernet connection
Select options as shown in the screenshot above, the “Local Area Connection 3″ I have selected is the name of the newly created loopback interface which should be replaced by the name displayed in your system. 


Step 3: Assign loopback interface to C1 port.


You may have to restart your computer for this loopback interface to show up in GNS3. Open GNS3 by right clicking it and choosing “Run as administrator”, insert a cloud node into the topology, right-click select configure.


Step 4: Configure Router R1


R1>enable
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface FastEthernet 1/0
R1(config-if)#ip address 10.255.255.2 255.255.255.252
R1(config-if)#no shutdown


Add a default route on this router.

R1(config)#ip route 0.0.0.0 0.0.0.0 10.255.255.1


Try pinging a public IP address and you should get a reply. Pinging domain names will result in an error as DNS has not yet been configured.

Configuring NAT for connecting to the internetBy now we have configured one GNS3 router to connect to the internet, if you connect more routers to this router connected to the cloud you will find that they are not able to communicate with the internet. This is because the physical machine does not know how to route the packets generated by the other routers of GNS3. The best solution for this is to perform Source NAT on the router connecting to the cloud. Take a look at the topology below which I will be using.


For R2 and R3 to connect to the internet we will be configuring NAT on R1 i.e. the router connected to the cloud.
R1(config)#access-list 10 permit any
R1(config)#ip nat inside source list 10 interface FastEthernet 1/0 overload
R1(config)#interface FastEthernet1/0
R1(config-if)#ip nat outsideR1(config)#interface FastEthernet0/0
R1(config-if)#ip nat insideR1(config)#interface FastEthernet0/1
R1(config-if)#ip nat inside


The interface fastethernet 1/0 is the one c0nnected to the Cloud hence it is the outside NAT interface. The “overload” keyword is used as we are doing Port Address Translation. Both R2 and R3 must have default routes pointing to R1 else it will not work.

3 comments:

  1. please guide us how to do this on linux based operating system?

    ReplyDelete
  2. It’s too informative blog and I am getting conglomerations of info’s. Thanks for sharing; I would like to see your updates regularly so keep blogging. If anyone looking ccna just get here
    Regards,
    ccna course in Chennai|ccna training in Chennai

    ReplyDelete
  3. Good Post. I like your blog. Thanks for Sharing
    Ping Speed Test

    ReplyDelete