Tuesday, July 17, 2012

Static Route


What is a Static Route

A static route is a route that is created manually by a network administrator and he give information to a router about way of other router . Static route are typically used in smaller networks. In static routing , the routing table entries are populated manually by a network administrator.

The opposite of a static route is a dynamic routing. In dynamic routing, the the routing table entries are populated with the help of routing protocol.

The major advantages of static routing are reduced routing protocol router overhead and reduced routing protocol network traffic. The major disadvantages of static routing are network changes require manual reconfiguration in routers and network outages cannot be automatically routed around. Also it is difficult to configure static routing in a complex network.

How to configure Static Routes

Static Route can be configured by the following IOS commands.
• Router(config)#ip route destination_network subnet_mask default_gateway [administrative_distance] [permanent]
OR
• Router(config)# ip route destination_network subnet_mask interface_to_exit [administrative_distance] [permanent]
The permanent keyword will keep the static route in the routing table even when the interface the router uses for the static route fails.

Example


the following IOS commands to open the fast ethernet interface Fa0/0 configuration mode on Router01 and configure IP address as 172.16.0.1/16.

Router01>enable
Router01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router01(config)#interface fa0/0
Router01(config-if)#ip address 172.16.0.1 255.255.0.0
Router01(config-if)#no shutdown

Use the following IOS commands to open the serial interface S0/0 configuration mode on Router01 and configure IP address as 172.17.0.1/16. You have to set a clock rate also using the "clock rate" command on S0/0 interface, since this is the DCE side.

Router01>enable
Router01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router01(config)#interface s0/0
Router01(config-if)#clock rate 64000
Router01(config-if)#ip address 172.17.0.1 255.255.0.0
Router01(config-if)#no shutdown

Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router.

Static Routing configuration in Router

Connect to Router console and use the following IOS commands to configure static routing in Router. The "ip route" commands shown below states that to reach 172.18.0.0/16, 172.19.0.0/16 and 172.20.0.0/16 networks, handover the packets to the gateway ip address 172.17.0.2. The networks 172.16.0.0/16 and 172.17.0.0/16 are conneted directly to Router

Router01>enable
Router01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router01(config)#ip route 172.18.0.0 255.255.0.0 172.17.0.2
Router01(config)#ip route 172.19.0.0 255.255.0.0 172.17.0.2
Router01(config)#ip route 172.20.0.0 255.255.0.0 172.17.0.2

Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router. To view the routing table in Router01, run "show ip route" command in Router01 as shown below.

Router01#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 172.16.0.0/16 is directly connected, FastEthernet0/0
C 172.17.0.0/16 is directly connected, Serial0/0
S 172.18.0.0/16 [1/0] via 172.17.0.2
S 172.19.0.0/16 [1/0] via 172.17.0.2
S 172.20.0.0/16 [1/0] via 172.17.0.2

The "S" character at the beginning of a line in routing table shows that it is a static route and "C" character shows that it is a directly connected network.


No comments:

Post a Comment