Difference between defining static routes with next-hop address or exit interface
For a long time I was confused about this. It was not clear to me what is the difference between setting the static route using next hop interface IP address instead of exit interface (outgoing interface) syntax. It seemed that both methods are the same and that you have basically two different ways to define static route on specific device for no particular reason.
It was not clear to me why would someone do this kind of option on networking device OS if there were no reason for doing so. In other words I was strongly convinced that there must be some difference between two configs and learning more detail about the process of routers recursive searches and Proxy ARP function did answer all my doubts.
So now is time to put it all on paper for you to see it:
You can define static route like this:
R1(config)#ip route 10.0.0.0 255.255.255.0 10.10.2.1
This means that all packets from R1 with destination address from 10.0.0.0/24 subnet will be forwarded out the interface leading to next hop device with 10.10.2.1 address on its interface.
Other way is to define the same static route like this:
R1(config)#ip route 10.0.0.0 255.255.255.0 fastEthernet 0/0
If fastEthernet 0/0 is the interface on R1 router that leads to next hop router with best path to 10.0.0.0/24
What’s the difference, which is better?
If you use next-hop address, you can conclude that your router will not have the information which interface must he use in order to route those packets out towards destination. R1 must then find an interface that is having 10.10.2.1 on other side.