cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
653
Views
0
Helpful
3
Replies

How does static route pointing to router interface work?

ekhoo
Level 1
Level 1

How does router know where to send a packet when I add static route with router interface instead of ip address of next hop?

Eg:

R1 is Internet router while R2 is user access router. These two routers has Ethernet interface F0/0 connect to the LAN switch and they can see each other. When I add a static route 0.0.0.0 0.0.0.0 F0/0 on the R2, how does it know to forward the traffic to R1 F0/0?

Regards,

Sean

3 Replies 3

ankurbhasin
Level 9
Level 9

HI Ekhoo,

The command is interpreted as

ip route

So when you specify any interface instead of next hop it is an exit interface for router and now when it checks the routing table it knows what is the exit interface.

Even when you specify next hop ip address and you check the routing table you will see by which interface it will move out in routing table.

Even for any routing protocol the routing table has an entry from which interface the route is learned because atlast the router will send the traffic out from its interface only from where it has learned the route.

So specifying the interface in default route or static route is the exit interface which you are specifying for route to send the traffic out from that interface.

HTH

Ankur

Hi

In addition to Ankurs comments particularly in broadcast media (i.e., in Ethernet) its better to point out the next hop ip address if possible in the static route or else add in conjunction with the static route.something like below mentioned statement

ip route 0.0.0.0 0.0.0.0 fa0/0 1.1.1.1

By doing this we can avoid unecessary arp requests being sent for any of the routes if thats not there in the routing table.

That will help in avoiding the unecessary load on the CPU which mite also create some performance related issues..

regds

I believe that Edwin has provided the essential part of the answer and that there are a few more details to fill in.

When you point a static route to an interface rather than pointing to a next hop address, the router must be able to map layer 3 destination addresses to layer 2 addresses so that it can build the layer 2 encapsulation for the outbound packet. On point to point interfaces this is easy. And point to point interfaces are where it makes the most sense to use static routes pointed to interfaces.

When you configure a static route pointing to an interface which is a multipoint interface like Ethernet then the router must have a MAC address for the next hop. To get the MAC address the router must ARP for every unique destination address that it is attempting to forward. This is generating extra work on the router to generate the ARP requests, is consuming extra memory to hold the entries in a much larger ARP table, and is generating extra traffic over the interface.

Another point to make is that for this to work the other router must support proxy ARP. Proxy ARP is enabled by default. In my experience more and more organizations are regarding proxy ARP as a possible security weakness and are adopting policies that disable proxy ARP as part of their standard config. To the extent that both routers are under your administrative control, you can make sure that proxy ARP is enabled. But to the extent that you may be routing to a next hop router that is not under your administrative control, the question of whether proxy ARP is enabled is something to be concerned about.

For these reasons it is generally better practice to limit static routes pointing to interfaces to situations where the exit interface is point to point and to use static routes with next hop addresses on LAN interfaces.

HTH

Rick

HTH

Rick
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