Cisco – Specify the next hop or the interface for static routes

best practicesciscostatic-routes

I'm setting up a bunch of static routes (this is a security requirement so don't ask why I'm not using routing protocols).

A static route can either be created by specifying the next hop

199.199.199.0 255.255.255.0 199.199.200.1

Or by secifying the outgoing interface

199.199.199.0 255.255.255.0 GigabitEthernet0/23

In this case Gi 0/23 has an ip of 199.199.200.2 and is directly connected to 199.199.200.1. There are multiple other static routes going out this same interface.

What is the best practice in this situation?

Edit: Based on the difference of answers I had to dig into this some more. From my experience Cisco doesn't give you two ways to do the same thing and this is what I found. Specifying an interface is not recommended if the interface has many destinations. Here are the links I found and thanks Vlad H for the accurate answer.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800ef7b2.shtml
http://www.cisco.com/en/US/docs/ios/12_2/iproute/command/reference/1rfindp1.html#wp1054112

Best Answer

If you don't specify a next-hop, the next-hop router should be configured to do proxy ARP. What will happen is that your router will do an ARP request whenever a packet is sent to a new destination which is not in the ARP table and the next-hop router should respond with its MAC on behalf of destination. This configuration is not recommended as there will be both a delay initially to do the ARP and if you have many routes like this (or even worse, I saw default routes like this!) you'll see memory and high cpu issues.

There will be no double route lookup or anything like that because on all decently modern routers, packets will be forwarded by CEF. Specifying just the interface will create a glean adjacency in CEF (which is similar to what happens for normal directly connected broadcast network) for the whole route. Then more specific /32 will be populated when ARPs arrive.

Related Topic