Static Routes in Cisco IOS

There are two types of routing that can be configured on a network device- static and dynamic. In this post we will try our best to cover almost everything about static route by defining it, having a look to it is code syntax and then configuring it using a real world scenario, so it is a little bit long tutorial there for i have divided it to the following two parts.
Part1: Static Routes in the Cisco IOS
Before reading any further more I would like to suggest you to read some of my previous posts specially the “Different Modes and Prompts ofa Cisco Router IOS” which I think has a little bit connection with this one and can be very helpful to understand some command used in this post.

Static vs Dynamic Routes

The static routes tell the device exactly where to send the traffic but the path "whether it would be the best or not" must be chosen by network admins, and in a large network infrastructure where more than hundreds or thousands of sources and destinations communicate with each other, it becomes very tough for network admins to perform their job, that is why it is said that static routes are very hard-coded, but for a network admin, knowing how to configure a static route is a requirement. Dynamic routes on the other hands are very easy to configure, and as they use routing protocols for best path selection so there is no need for network admins to panic. with dynamic routes, routers communicate with each other and exchange routing information. Some examples of dynamic routing protocols are RIP, EIGRP, OSPF and BGP.

Basics of Static Routes

Now that you know the difference between static and dynamic routes lets discuss some basics of static routes. When there are two or more routes to the same destination, routes uses administrative distance to decide which routing protocol or static route to trust more. In case if you don't know administrative distance is the measure which defines the reliability of a routing protocol, each routing protocol has a numeric AD value "the lower the value, the more trustworthy the type of route is" following is the list of some routing protocol with their Administrative Distance Values. 

Protocol
Administrative Distance
Directly Connected Route
0
Static Route out and interface
0
Static route to next-hop address
1
EIGRP summary route
5
External BGP
20
Internal EIGRP
90
IGRP
100
OSPF
110
IS-IS
115
RIP
120
EGP
140
ODR
160
External EIGRP
170
Internal BGP
200
DHCP-learned
254
Unknown
255

So because of how administrative distance works when you define a static route that is same as a dynamic route, your static route will be used over the dynamic route. As you may be overriding routes manually make sure that the routes you are defining are accurate.
As you may have noticed in above table that there are static routes that point to an interface on the router with an administrative distance of 0 which may tella router to send all traffic going to X network out interface Fast Ethernet 0/0, and static routes that point to an IP address on the network with an administrative distance of 1 which may tell a router to send all traffic going to X network to IP address 10.1.1.1. Either of these types of routes can be used, depending on the situation.

Default Route

There is a special kind of static route known as default route which tells a router to send all traffic to specified destination if no specific route found in routing table for that traffic. Sometimes it is also called as a "zero/zero" route. this is because the IP address and subnet you are specifying , as a destination for the route matches the zero.

The Syntax

The syntax for command which is used in global configuration mode to enter to static route is:
ip route {destination prefix} {destination prefix mask} {interface OR forwarding routers IP address}

for example" a static route sending all traffic out to serial 0/0 would look like this

MNL(config)#ip route 0.0.0.0 0.0.0.0 serial0/0

A specific route, sending traffic going to network 20.20.20.20, to router 1.1.1.1, would look like this:
MNL(config)#ip route 20.20.20.0 255.255.255.0 1.1.1.1

After that you have configured both these routes, you can use show ip route command to see the routing table:

MNL#Show ip route

Codes: C – connected,S – static,R – RIP M – mobile,B – BGP

             D – EIGRP, EX – EIGRP external, 0 – OSPF, IA – OSPF  inter  area

             N1 – OSPF NSSA external type 1, N2 – OSPF NSSA  external  type2

             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 – users

atic route

             o – ODR, P – periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

            1.0.0.0/24 is subnetted, 1 subnets

C               1.1.1.0 is directly connected, Serial0

            10.0.0.0/24 is subnetted, 1 subnets

S                10.10.10.0 [1/0] via 1.1.1.1
C          192.168.1.0/24 is directly connected, Ethernet0
S*         0.0.0.0/0 is directly connected, Serial0
MNL# 

In above routing table the static routes are indicated with latter S, default route with latter S* and latter C shows the connected interfaces of the router.

Conclusion

You have now learned how to configure both static and default routes if you have any question Regarding this Tutorial fell free to ask. In Our upcoming part which is coming soon, we will configure both of them using a real world scenario so stay tuned for upcoming part till then peace and blessings J

Static Routes in Cisco IOS Static Routes in Cisco IOS Reviewed by Ahmad Waleed Khaliqi on 7:03 AM Rating: 5

No comments:

Powered by Blogger.