Tuesday, November 4, 2008

Cisco Static Route

In my previous post on Static route configuration, I have touched on some basic of static route configuration. In this post, I will show you more details on how to configure static routing in Cisco devices.

IP routing is enabled on Cisco routers by default. If it has been previously disabled on your router, you can turn it on in config mode with the command ip routing.
Router0(config)#ip routing
Router0(config)#ctrl-Z
For routers to send or forward packets to networks that are not directly connected, they must know the path to reach the destination network. This information can be manually configured in router by network administrator -- the use of static routes. The router can also learn routes information by using a dynamic routing protocol. Anyway, static route is much easier to be configured. However, it provides very little fault tolerance or ability to discover new routes as the network changes.

As mentioned in my previous post, static routes are hard-coded on a router or switch. They tell the network device exactly where to send traffic, no matter what. It is a very quick and effective way to route data from one subnet to another subnet although it does not scale well in large network.


To create a static route in the Cisco IOS, it is done with the ip route command. The syntax for the global configuration command used to enter a static route is:
ip route <destination prefix> <destination netmask> <next hop or exit interface>
As indicated, you may point destination network towards a local exit interface of the router or to an IP address on the network.

For example, a static route sending all traffic out local exit point Serial0 interface would look like this:
Router0#config
Router0(config)#ip route 10.0.0.0 255.255.255.0 Serial0
Router0(config)#ctrl-Z
A specific route, sending traffic going to network 10.0.0.0, to router 192.168.150.1, would look like this:
Router0#config
Router0(config)#ip route 10.0.0.0 255.255.255.0 192.168.150.1
Router0(config)#ctrl-Z
There is a special kind of static route called a default route.  It is often called the 'route of last resort'. For any traffic that does not match a specific route in the routing table, it will be send to this default route.

A default route is configured on a Cisco router with the following command:
Router0(config0#ip route 0.0.0.0 0.0.0.0 <next hop or exit interface>
Router0(config)#ctrl-Z
To view the IP routing table, you may use the following commands:
Router0#show ip route
This is just the basics of static routing in Cisco IOS configuration. There are many more topics on static route configuration. I may cover it in future posts.

No comments:

Post a Comment