Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Configuring IP Static Routes with Indirect Next Hops

    You can configure static routes where next hops are not on directly connected interfaces. Such a route is usable, and appears in the route table, only if another route in the route table can resolve the next hop.

    The resolving route can be either statically created or dynamically learned by a routing protocol (like RIP, BGP, OSPF, and so on).

    Note: When configuring this type of static route, the route that resolves the next hop must have an administrative distance value that is better (lower) than the distance of the static route you want to resolve.

    Figure 1: Static Routes with Indirect Next Hops

    Static Routes with Indirect Next Hops

    On the Boston router in the network shown in Figure 1:

    1. Configure a static route to 10.2.0.0/16 with a next hop of 10.5.0.2 (which is not directly connected) and an administrative distance of 254 (which is worse [higher] than the default administrative distance for static routes [1]).
      host1(config)#ip route 10.2.0.0 255.255.0.0 10.5.0.2 254
    2. Configure another static route that resolves 10.5.0.2 and uses the default administrative distance.
      host1(config)#ip route 10.5.0.0 255.255.255.252 10.1.0.2 [ 1 ]

      Note: The previous example shows the default administrative distance value, 1, to illustrate the difference between the two static route commands. However, you do not have to enter this value when issuing the command.

      A static route to 10.2.0.0 is added to the route table with a next hop of 10.1.0.2 (on the directly connected Ethernet interface).

      Note: A dynamically learned route can also resolve indirect next hops, as long as the administrative distance value of the learned route is better (lower) than the static route whose next hop is being resolved.

    Published: 2014-08-13