cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
572
Views
22
Helpful
11
Replies

Giving a static route - a doubt

omal
Level 1
Level 1

Hi

I have a doubt in giving a static route.

We have two options:

1. Give the next hop's IP address

e.g. ip route 10.2.2.0 255.255.255.0 10.1.1.1

2. Give the outgoing interface

e.g. ip route 10.2.2.0 255.255.255.0 serial 0

When do we need the first option and when do we need the second option?

OR

This is not a very useful option, because the AD (administrative distance) of a static route is 1 and a connected interface is 0, therefore whether we give option 1 or option 2, the router will choose these instead of a path that it had learnt through a dynamic routing protocol, as the AD is higher?

I'm a bit confused as to why we have two like this and when do we have to make a decision as to which one are we going to use for a particular incident.

Thanks in advance!

1 Accepted Solution

Accepted Solutions

Specifying a numerical next hop on a directly connected interface will prevent the router from performing ARP or each destination address.

tHIS saves from utilization of processor and a very large ARP cache

Hope this info helps you.

Check this link for more details

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800ef7b2.shtml

Thanks

Raj

View solution in original post

11 Replies 11

Richard Burts
Hall of Fame
Hall of Fame

Omal

As you mention there are two forms of static route one of which specifies the outbound interface and the other specifies the next hop. The first type which specifies the outbound interface is especially useful when the outbound interface is point to point and is more problematic if the outbound interface is multi-access like Ethernet. The second type which specifies the next hop can always be used.

As you say the default administrative distance for either type of static route is 1 and will make the static route more attractive than a route learned by a dynamic routing protocol. There is an option with static routes to give an administrative distance higher than the default which may allow the dynamic protocol route to be more attractive. This is called floating static route. An example would be:

ip route 192.168.4.0 255.255.255.0 172.18.14.1 250

where the last 250 is the administrative distance. In this case if a dynamic routing protocol has a route for 192.168.4.0 then the dynamic route will be used. But if there is no dynamic route then the static will be used.

HTH

Rick

HTH

Rick

gpulos
Level 8
Level 8

i've always found it best to use the next hop IP address. this way there is no question about the route when viewing it.

to see a route via Serial 0, tells me nothing about the ip address/subnet of that link.

as far as why, i do not think there is any valid reason to use one option over the other. they both provide the same result.

you are also correct at stating the "router will choose these instead of a learnt route". this is, just as you've said, because the AD is lower for a static route versus a dynamic route.

i feel a best rule of thumb, best practice is to use the next HOP IP addy. (but hey, ima ol' skool routing man....well before being able to assign an interfaceName as the next hop)

devang_etcom
Level 7
Level 7

both are install static route with the same AD of 1... directly connected network install with AD 0 in routing table...

and lower the AD more preferable that information...

let say you are runing RIP and OSPF on your network... as RIP is having AD of 120 and OSPF 110... so information of OSPF is prefered over the rip as OSPF AD is lower then the RIP... so router always select the information with the lowest AD...

rate this post if it helps

regards

Devang

Hi ,

When you go for Option#1 the AD will be 1 and when you go for Option#2 AD will be 0 .

As for router Option#2 ( because u r mentioning Serial0 of your own router) is more reliable than Option#1(because u r mentioning IP address of other router)

HTH

regards

Abhishek

Hi Abhishek

I agree with the ADs that you've said. In fact I also read it in a book that if you give the static route pointing to your own interface, you are telling the router that it is a connected network. Therefore the AD is 0 and on the other hand, if you give the next hop the router will take it as a static route with an AD of 1.

Richard on the other hand given the answer for my other question. i.e. He has given an example as to when we use them. In a multipoint scenario, we need to give the next hop's IP address, while at other times we can give the outgoing interface. I think if we give the outgoing interface, we help the router to save his resources in doing recursive lookup to findout the outgoing interface. On the other hand, if we give the next hop's IP address, then the router will have to do the recursive lookup.

I hope I'm correct. But please correct me if I'm wrong.

Thanks a lot everyone!

Actually, it's the other way around. When the static route is pointing to an outgoing interface the router thinks all the hosts within the range of the route is directly connected to that interface and would ARP for all those hosts. This can result in high CPU utilization and bigger ARP cahce if there are lot of packets to many different destinations out that interface.

The best practice is to point the next hop of a route to an IP address rather than the outgoing interface and this would save you a lot of headache.

HTH,

Sundar

I know that there are some books which state that a static specifying an interface gets administrative distance of 0 and a static specifying next hop gets an administrative distance of 1. But they are incorrect.

It is relatively easy to verify what the behavior is. Configure a router with these two static routes:

ip route 1.2.3.4 255.255.255.255 serial0

ip route 5.6.7.8 255.255.255.255 10.10.10.1

and then do show ip route 1.2.3.4 and show ip route 5.6.7.8 and you will find that they both have administrative distance of 1.

HTH

Rick

HTH

Rick

Hi Rick

Thank you so much for your reply. Yes you also have a very valid point. But then what I'm confused is that, why we have two options like that?

Thanks in advance!

Specifying a numerical next hop on a directly connected interface will prevent the router from performing ARP or each destination address.

tHIS saves from utilization of processor and a very large ARP cache

Hope this info helps you.

Check this link for more details

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800ef7b2.shtml

Thanks

Raj

Omal

There are two options because sometimes one way is better and other times the other way is better, and sometimes both ways work equally well.

Let me show an example in which the option to point to the interface is much better than the option pointing to an address.

interface FastEthernet0/0

ip address 172.19.1.1 255.255.2558.0

interface Serial0/0

ip unnumbered FastEthernet0/0

If I want to configure a default route sending traffic to the neighbor on the serial interface then the option:

ip route 0.0.0.0 0.0.0.0 serial0/0

will work quite well. Trying to configure this default route using the option with next hop address is quite difficult since the neighbor on the serial interface is not in the same subnet as the address on the serial interface (which is using the subnet from the FastEthernet). How do I identify the address on the serial interface of the neighbor?

So you need to look at each situation and decide if one option works better than the other option. Each option has some circumstances where it works the best.

HTH

Rick

HTH

Rick

Hi Rick

Thank you very much for taking time to resolve my issue. What you say clearly makes sense.

I think I got an idea now.

Thank you so much!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card