Static Routing configuration different ways

Today I am going to talk about the Static routing and default routing. Some of you already know about the both these but some of you guys are still not aware about this stuff. This article is basically for the starters in the Networking field.


Fig 1.1- Sample Static routing configuration

Let's talk about the IP routing first with the static routing. When using the ip route command, you can identify where packets should be routed to in two ways: 
  • The next-hop address 
  • The exit interface 
Way-1 :The Next-Hop Address
Router(config)#ip route 172.16.20.0 255.255.255.0 172.16.10.2
172.16.20.0 = destination network
255.255.255.0 = subnet mask 
172.16.10.2 = next-hop address
What does it means: To get to the destination network of 172.16.20.0, with a subnet mask of 255.255.255.0, send all packets to 172.16.10.2  

Way-2 :The exit interface
Router(config)#ip route 172.16.20.0 255.255.255.0 s0/0
172.16.20.0 = destination network 
255.255.255.0 = subnet mask s0/0 = exit interface
What does it means: To get to the destination network of 172.16.20.0, with a subnet mask of 255.255.255.0, send all packets out interface Serial 0/0

The permanent Keyword
Another interesting thing which i am sure most of you don't know about it and this is using the permanent with the next hop address.
Router(config)#ip route 172.16.20.0 255.255.255.0 172.16.10.2 permanent
What does it means: Specifies that the route will not be removed, even if the interface shuts down 

With the use of the permanent keyword at the end the route will not be removed even the interface is shut down. Without permanent keyword a static route will be removed if an interface goes down.

Static Routes and Administrative Distance
Another way is to add the Administrative distance at the end of the static route with the next-hop address. This is another way to route the static route with AD value.

Router(config)#ip route 172.16.20.0 255.255.255.0 172.16.10.2 200
What does it means:Specifies that an administrative distance of 200 has been assigned to this route.
By default, a static route is assigned an administrative distance (AD) of 1. Administrative distance rates the “trustworthiness” of a route. AD is a number from 0-255, where 0 is absolutely trusted, and 255 cannot be trusted at all. There- fore, an AD of 1 is an extremely reliable rating, with only an AD of 0 being better. An AD of 0 is assigned to a directly connected route. The following table lists the administrative distance for each type of route.

Default Routing
Router(config)#ip route 0.0.0.0 0.0.0.0 172.16.10.2
Send all packets destined for networks not in my routing table to 172.16.10.2

Router(config)#ip route 0.0.0.0 0.0.0.0 s0/0
Send all packets destined for networks not in my routing table out my Serial 0/0 interface