Wednesday, October 10, 2012

Static routes with outgoing interface or next-hop IP-address.

For static routes there are two options available:
ip route x.x.x.x x.x.x.x [next-hop-ip-address | outgoing interface]
It is said that when you specify the next-hop address it will cause a router to look in its routing table twice - first time to find the destination network and second time to find the outgoing interface. Therefore it is more advisably to specify the outgoing interface instead of next-hop ip address.
Let's investigate what will happen in this topology:
At the top of the picture there are mac-addresses of interfaces e0/0.
R3 has a static route to network 192.168.0.0/24.
Let's run wireshark on the link between routers and find out what it will send with simple "ping 192.168.0.10".
R3#ping 192.168.0.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.10, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

It doesn't matter that ping fails. Let's look into the dump:
R3 sends arp-request out of e0/0 for ip-address 192.168.0.10 even though this address is not in the same subnet as this interface. Furthermore R4 answers to this request with its mac-address. The reason for this is arp proxy. And after receiving this reply R3 starts pinging destination ip-address using this mac-address as destination.
But what will happen if I disable arp proxy?
R4(config)#int e0/0
R4(config-if)#no ip proxy-arp

As you can see R3 continuously sends arp-requests without success. This means that disabling arp proxy on the other side of the outgoing interface will completely destroy your static route with specified outgoing interface.
This is the reason why I prefer using static routes with next-hop address instead of outgoing interface.

No comments:

Post a Comment