IP Routing: Protocol-Independent Configuration Guide, Cisco IOS Release 15M&T
PBR Recursive Next Hop
Downloads: The complete bookPDF (PDF - 4.33 MB) | The complete bookePub (ePub - 844.0 KB) | Feedback

PBR Recursive Next Hop

PBR Recursive Next Hop

The PBR Recursive Next Hop feature enhances route maps to enable configuration of a recursive next-hop IP address that is used by policy-based routing (PBR). The recursive next-hop IP address is installed in the routing table and can be a subnet that is not directly connected. If the recursive next-hop IP address is not available, packets are routed using a default route.

Because Cisco Express Forwarding (CEF) or process switching provides the infrastructure, the benefit of this feature is the CEF loadsharing.

Feature History for the PBR Recursive Next Hop Feature




This feature was introduced.


This feature was integrated into Cisco IOS Release 12.3(14)T.

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/​go/​cfn. An account on Cisco.com is not required.

How to Configure PBR Recursive Next Hop

Setting the Recursive Next-Hop IP Address

The infrastructure provided by CEF or process switching performs the recursion to the next-hop IP address. The configuration sequence, which affects routing, is as follows:

  1. Next-hop

  2. Next-hop recursive

  3. Interface

  4. Default next-hop

  5. Default interface

If both a next-hop and a recursive next-hop IP address are present in the same route-map entry, the next-hop is used. If the next-hop is not available, the recursive next-hop is used. If the recursive next-hop is not available and no other IP address is present, the packet is routed using the default routing table; it is not dropped. If the packet is supposed to be dropped, use the set ip next-hopcommand with the recursive keyword followed by a set interface null0 configuration.


Match interface is not supported on Cisco Catalyst 3750 series devices.

Perform this task to set the IP address for the recursive next-hop router.

Before You Begin

If loadsharing is required, CEF loadsharing should be configured for per-packet or per-destination loadsharing. Loadbalancing should be done over all equal-cost routes to the subnet that have been configured by the set ip next-hop recursivecommand.

This functionality should be available in centralized and distributed systems.


Only one recursive next-hop IP address is supported per route-map entry.


    1.    enable

    2.    configure terminal

    3.    access-list permit source

    4.    route-map map-tag

    5.    set ip next-hop ip-address

    6.    set ip next-hop {ip-address [...ip-address] | recursive ip-address}

    7.    match ip address access-list-number

    8.    end

     Command or ActionPurpose
    Step 1 enable

    Router> enable

    Enables privileged EXEC mode.

    • Enter your password if prompted.

    Step 2 configure terminal

    Router# configure terminal

    Enters global configuration mode.

    Step 3 access-list permit source

    Router(config)# access-list 101 permit

    Configures an access list. The example configuration permits any source IP address that falls within the subnet.

    Step 4 route-map map-tag

    Router(config)# route-map abccomp

    Enables policy routing and enters route-map configuration mode.

    Step 5 set ip next-hop ip-address

    Router(config-route-map)# set ip next-hop

    Sets a next-hop router IP address.


    Set this IP address separately from the next-hop recursive router configuration.

    Step 6 set ip next-hop {ip-address [...ip-address] | recursive ip-address}

    Router(config-route-map)# set ip next-hop recursive

    Sets a recursive next-hop IP address.


    This configuration does not ensure that packets get routed using the recursive IP address if an intermediate IP address is a shorter route to the destination.

    Step 7 match ip address access-list-number

    Router(config-route-map)# match ip address 101

    Sets an access list to be matched.

    Step 8 end

    Router(config-route-map)# end

    Exits route-map configuration mode and returns to privileged EXEC mode.


    Verifying the Recursive Next-Hop Configuration

    To verify the recursive next-hop configuration, perform the following steps.


      1.    show running-config | begin abccomp

      2.    show route-map map-name

      Step 1   show running-config | begin abccomp

      Use this command to verify the IP addresses for a next-hop and recursive next-hop IP address, for example:

      Router# show running-config
       | begin abccomp
      route-map abccomp permit 10
       match ip address 101 ! Defines the match criteria for an access list.
       set ip next-hop recursive ! If the match criteria are met, the recursive IP  address is set.
       set ip next-hop
      Step 2   show route-map map-name

      Use this command to display the route maps, for example:

      Router# show route-map abccomp
      route-map abccomp, permit, sequence 10
       Match clauses:
        ip address (access-lists): 101 
       Set clauses:
        ip next-hop recursive
        ip next-hop
       Policy routing matches: 0 packets, 0 bytes

      Configuration Examples for PBR Recursive Next Hop

      Example: Recursive Next-Hop IP Address

      The following example shows the configuration of IP address as the recursive next-hop router:

      route-map abccomp
       set ip next-hop
       set ip next-hop
       set ip next-hop recursive
       set ip next-hop

      The following example shows the configuration of IPv6 address 2001:DB8:2003:1::95 as the recursive next-hop router:

      route-map abccomp
       set ipv6 next-hop 2001:DB8:2003:1::95
       set ipv6 next-hop 2001:DB8:2004:3::96
       set ipv6 next-hop recursive 2001:DB8:2005:2::95
       set ipv6 next-hop 2001:DB8:2006:1::95

      Additional References

      The following sections provide references related to the PBR Recursive Next Hop feature.

      Related Documents

      Related Topic

      Document Title

      IP routing commands: complete command syntax, command mode, command history, defaults, usage guidelines, and examples

      Cisco IOS IP Routing Protocols Command Reference



      MIBs Link

      No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature.

      To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:


      Technical Assistance



      The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies.

      To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds.

      Access to most tools on the Cisco Support website requires a Cisco.com user ID and password.


      Command Reference

      The following commands are introduced or modified in the feature or features documented in this module. For information about these commands, see the Cisco IOS IP Routing: Protocol-Independent Command Reference. For information about all Cisco IOS commands, use the Command Lookup Tool at http:/​/​tools.cisco.com/​Support/​CLILookup or the Cisco IOS Master Command List, All Releases, at http:/​/​www.cisco.com/​en/​US/​docs/​ios/​mcl/​allreleasemcl/​all_​book.html.

      • set ip next-hop

      • show route-map