In this topic I am going to talk about the way to configure and working of static routing.Routers forward packets to next hop by using routing table which is either manually configured through static routes or the route information is calculated using Dynamic routing algorithms. Static routes is used in environment where network traffic is predictable and network design is simple. Static routes are also useful for specifying a gateway of last resort (a default router to which all unroutable packets are sent).
Static routing have pros and cons:
Pros:
1.Static routes use less bandwidth than Dynamic routes.
2. No CPU cycles are used to calculate and analyze routing updates.
3.More administrator control over routing.
4. Static routes are not advertised over the network, resulting in better security.
Cons:
1.No automatic updated, you must manually reconfigure static routes when network changes occur.
2.Require more manual effort than dynamic routing.
3.Not advisable to use in large, constantly changing networks.
Below is the example showing static routing
Three routers INB_R1,INB_R2and INB_R3 are connected in series. Host INB_A is configured with gateway of router INB_R1 Ip address 172.16.1.1 and Host INB_B is configured with gateway of router INB_R3 Ip address 192.168.1.1.
Configuration on Router INB_R1:
INB_R1 (Config t ) # ip route 20.88.0.0 255.255.0.0 10.88.0.2
INB_R1 (Config t ) # ip route 192.168.1.0 255.255.255.0 10.88.0.2
Configuration on Router INB_R2:
INB_R2 (Config t ) # ip route 172.16.1.0 255.255.255.0 10.88.0.1
INB_R2 (Config t )# ip route 192.168.1.0 255.255.255.0 20.88.0.2
Configuration on Router INB_R3:
INB_R3 (Config t )# ip route 172.16.1.0 255.255.255.0 20.88.0.1
INB_R3 (Config t )# ip route 10.88.0.0 255.255.0.0 20.88.0.1
Command used to configure Static route:
ip route { ip-prefix | ip-addr/ip-mask } {[ next-hop | nh-prefix ] | [ interface next-hop | nh-prefix ]} [ name nexthop-name] [ tag tag-value] [ pref ]
Floating Static Routes
A floating static route is a static route that the router uses to back up a dynamic route. You must configure a floating static route with a higher administrative distance than the dynamic route that it backs up. In this instance, the router prefers a dynamic route to a floating static route. You can use a floating static route as a replacement if the dynamic route is lost.
Note: By default, a router prefers a static route to a dynamic route because a static route has a smaller administrative distance than a dynamic route.
Eg: ip route 192.168.1.0 255.255.255.0 20.88.0.2 200
200 is the Administrative distance added to create floating route.
Default Route
Default route used in case there is no specific entry in routing table for destination IP address. Default route send all the unmatched traffic to the interface /Ip address specified in default route command. Below are the two cases in which default route mostly used:
1.When you have STUB network and have no second path to route traffic.
2.When you want your unmatched destination traffic send to specific interface/IP address.
Command used to configure Default route:
ip route 0.0.0.0 0.0.0.0 {[ next-hop | nh-prefix ] | [ interface next-hop | nh-prefix ]}