- Gold, 750 points or more
This document describes the difference between implementation of static routes with next hop as an exit interface or an IP address.
For forwarding packet to the destination, the router must determine the exit interface and rewrite the L2 frame before putting the packet on the wire. In order for a router to write the L2 frame it must resolve the IP address to its corresponding L2 address and reconstruct the frame before sending to the next hop. The function of address resolution can be done dynamically using protocols like ARP in Ethernet or Statically/Dynamically learned DLCI in frame-relay.
There are two points need to be understand, when you configure static route on router.
1) If you configured static route pointed to next hop IP address, for every destination forwarding router requires only L2 address of next hop IP address to rewrite the L2 frame.
Example: ip route 220.127.116.11 255.255.255.0 10.1.1.2
For routing packet to destination address 18.104.22.168, router requires L2 mac address of 10.1.1.2.
2) If you configured static route point to outgoing interface, forwarding router assume destination address is directly connected to that interface and router will try to find the L2 address of the destination by sending ARP request out of the interface to the destination address in case of Ethernet or looking for a static/dynamic map entry in the mapping table in case of frame-relay.
Example: ip route 22.214.171.124 255.255.255.0 fa0/0
For routing packet to the destination address 126.96.36.199, router assumes host 188.8.131.52 is directly connected to the interface fa0/0 and it requires L2 mac address for 184.108.40.206.
In general, interfaces can be point to point or multi-point. The above mentioned conditions work differently in scenarios of Point to point and multipoint interface.
In point to point interface, by definition two devices are directly connected, so in case if you configure static route pointing to outgoing interface or next hop IP address does not make a difference, router uses L2 address of next hop IP address of interface for routing packet to every destination address.
In multipoint interface, by definition interface can have multiple devices connected to it. So as mention above in point number two, if you configure static route point to next-hop, router need L3 to L2 resolution for each destination prefixes. Ethernet is an example of multi-point interfaces whereas Frame-relay and ATM can be multi-point interface or point to point depending on the configuration.
The topology and initial configurations are shown below:
ip address 220.127.116.11 255.255.255.255
ip address 10.1.1.2 255.255.255.252
ip address 18.104.22.168 255.255.255.0
ip route 22.214.171.124 255.255.255.255 10.1.1.1
ip route 126.96.36.199 255.255.255.255 188.8.131.52
ip address 184.108.40.206 255.255.255.255
ip address 10.1.1.1 255.255.255.252
ip route 0.0.0.0 0.0.0.0 10.1.1.2
ip address 220.127.116.11 255.255.255.255
ip address 18.104.22.168 255.255.255.252
ip route 0.0.0.0 0.0.0.0 22.214.171.124
Case1: Configured static route on R2 point to the next hop address of neighboring router R1. As discussed above, for forwarding every packet to destination prefix R2 will use destination mac address of R1 in L2 frame.
Verifying connectivity from R2 to R1 and R3 loopback addresses:
Case2: Configured a static route on R2 point to the outgoing interface. As discussed above, for forwarding every packet R2 assume destination address is directly connected to that interface and will try to find the L2 mac address of the every destination by sending ARP request out of the interface to the destination address.
Connectivity verification from R2 to R1 and R3 loopback addresses. Also IP packet debug turned on R2 to get closer packet level view.
As 126.96.36.199 and 188.8.131.52 prefixes are not directly connected to fa0/0, R2 is not getting L2 mac address of these prefixes hence ARP table entry is showing incomplete and there is L2 encapsulation failure on R2 is dropping packets for this destination.
There are two tricky works around are available but these are not solutions just explained for user’s information.
1) Enabling proxy ARP on next hop router:
If you enable proxy ARP on router, Whenever router get address resolution request it send the proxy ARP of its own interface address to the requested router, Only if the prefixes are present in its routing table.
In this example R1 sends proxy ARP i.e. L2 mac address of 10.1.1.2 to R2 for prefixes 184.108.40.206 and 220.127.116.11, as both are in its routing table. By default proxy ARP is enable on the most of the routers.
Take closer look at Arp table of R2, it is showing that same mac address present for 18.104.22.168 and 22.214.171.124 prefixes in address resolution table because R1 is sending proxy ARP of its own interface address.
Hence this could result in a large amount of broadcast traffic and a large no of ARP cache on R2, especially if the static route was a default route used for internet traffic.
2) Adding manual ARP entries in ARP table:
You can also add manual ARP entries for destination prefixes to build L2 frame as shown below:
To build L2 frame for each destination prefixes you will need to add manual entries in address resolution table.
->For point to point interfaces, you can use static routes that point to the interface or to the next hop address. There is only one possible next hop and its L2 address will be used to build L2 frame.
->For multipoint/Broadcast interfaces, it is more suitable to use static routes that point to a next hop address to avoid the need for resolving every destination address to its L2 address. As you have seen above it is still possible to use static routes pointing to the interface but not a scalable solution.