How to Configure Static routing
First of all lets configure static routing in the form of default routing on the cisco routers. This lab is done in gns3 and with 2691 router series on Microsoft Windows Xp.
What we are going to do in this lab is we will connect our routers running inside gns3 to the internet through Microsoft loopback adapter.
Detailed description of the diagram:
As you can see in the figure , There is an internet cloud which i have used to represent internet connection. I have attached microsoft loopback adapter to this cloud and
Configured Internet connection sharing between the physical interface (ie interface connected to the internet physically) and loopback adapter. so that my loopback adapter
is connected to the internet. (note: do not configure your physical interface with ip range 192.168.0.0/24 as this is the range given to loopback adapter while configuring internet
connection sharing). The loopback adapter is connected to our router R1.. We will be configuring static routing in this router as a result the router can connect to internet. We will
test this by sending ping packets to various sites on the internet.
Configuration
1> Lets first create a loopback adapter and give it a name internetconnection
Go to Start -->Run--->type hdwwiz.cpl (shortcut to hardware addition wizard) ---->Next
Select Yes I have already added the hardware and click next
select Add a new hardware device and click next
select install the hardware that i manually select from the list and click next
select Network adapters and then select Microsoft Loopback adapter and click next
Click Next and finish
Go to Start-->Run--->type ncpa.cpl and rename the loopback adapter to internet connection
2> Now that we have configured loopback adapter lets configure internet connection sharing to this loopback adapter from physical interface
Here I am sharing my wireless connection to loopback (But you can share your physical connection)
Go to Start--->Run----> ncpa.cpl and select your physical connection
Right click your physical connection and go to properties --- >Advanced ---> Select Allow other users to connect to internet through
this network interface --- > ok
3> Now goto GNS3
drag router 2691 and cloud to the console
Right click the cloud and goto to configuration
In the configurator node on the left select C1 and on the right in NIO ethernet tab select loopback adapter from list of available adapters and
click add and then click apply
Now from the top menu select Add a link and connect the cloud to routers fa0/0 interface
4>Right click the router and do start
Right click the router and go to console
now do the following ( note before going to below configuration if you are new to this site then please refer
my basic cisco device configuration section here Basic Cisco Device Configuration
R2>
R2>en
R2#config t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#inter
R2(config)#interface fa
R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 192.168.0.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#e
*Mar 1 00:00:54.611: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:00:55.611: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config)#exit
R2#ping
*Mar 1 00:00:57.211: %SYS-5-CONFIG_I: Configured from console by console
R2#ping 192.168.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 20/26/32 ms
above we have given the ip 192.168.0.2/24 to router interface fastethernet 0/0 and we have connectivity to the clouds/loopback address ( remember to disable all the firewalls
and disble the antivirus because sometime antivirus will block network traffic)
Now lets try to ping to internet
R2#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
above I have tried to ping 8.8.8.8 which is googles name server and it clearly shows that the ping is failing.
If we do R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.0.0/24 is directly connected, FastEthernet0/0
then the result clearly shows that the router only knows how to reach 192.168.0.0/24 network and any other netoworks the router doesnt know about.
So Now here we have to configure static routing on the router by doing
R2#config t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.1 (This tells the router that to reach any network i.e 0.0.0.0/0.0.0.0 forward the packet to 192.168.0.1 and since we have shared our internet connection packets will be
forwarded to the internet
now check the router routing table, you wll find the newly added route
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 192.168.0.1 to network 0.0.0.0
C 192.168.0.0/24 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 192.168.0.1
Now the ping will reach the destination
R2#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 360/374/396 ms
you can also give name server to the router and ping using names like www.google.com by doing
R2(config)#ip na
R2(config)#ip nam
R2(config)#ip name-server 8.8.8.8
R2(config)#ip do
R2(config)#ip domain-loo
R2(config)#ip domain-lookup
R2(config)#exit
R2#ping
*Mar 1 00:11:04.923: %SYS-5-CONFIG_I: Configured from console by console
R2#ping www.google.com
Translating "www.google.com"...domain server (8.8.8.8) [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 74.125.235.17, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 344/349/372 ms
Thank you for being with me, we will meet you in my next post i.e RIP routing
I loved ur posts and wat information that u issued is really very usefull for us .. thanks...............
ReplyDeleteConfigure Internet Connection
Very Helpful thanks a lot. :)
ReplyDeleteThank for the informative post very refreshing is helpful.
ReplyDeletelove IT