Static routes: next-hop IP or exit interface — which should I configure?
ip route 10.2.0.0 255.255.255.0 192.168.1.2 versus ip route 10.2.0.0 255.255.255.0 g0/1 — both seem to work in my lab. Is there a real difference?
1 Answer
On point-to-point links they behave the same; on multi-access (Ethernet) segments the difference bites. With a next-hop IP, the router resolves that IP's MAC once and forwards cleanly. With only an exit interface on Ethernet, the router must ARP for every destination host as if it were directly connected — it works only if the neighbor happens to run proxy ARP, bloats ARP tables, and breaks silently when proxy ARP is disabled (as security guides recommend). Best practice: specify the next-hop IP, or both (ip route … g0/1 192.168.1.2), which also ties the route's validity to the interface state. Exit-interface-only is fine on serial/PPP links where there's exactly one possible neighbor.