Guest

Cisco IOS Software Releases 12.0 S

PBR Recursive Next Hop

  • Viewing Options

  • PDF (238.8 KB)
  • Feedback
PBR Recursive Next Hop

Table Of Contents

PBR Recursive Next Hop

Contents

How to Configure PBR Recursive Next Hop

Setting the Recursive Next-Hop IP Address

Prerequisites

Restrictions

Verifying the Recursive Next-Hop Configuration

Configuration Examples for PBR Recursive Next Hop

Recursive Next-Hop IP Address: Example

Additional References

Related Documents

MIBs

Technical Assistance

Command Reference

set ip next-hop

show route-map


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 load sharing.

Feature History for the PBR Recursive Next Hop Feature

Release
Modification

12.0(28)S

This feature was introduced.

12.3(14)T

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


Finding Support Information for Platforms and Cisco IOS Software Images

Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.

Contents

How to Configure PBR Recursive Next Hop

Configuration Examples for PBR Recursive Next Hop

Additional References

Command Reference

How to Configure PBR Recursive Next Hop

This section contains the following procedures:

Setting the Recursive Next-Hop IP Address (required)

Verifying the Recursive Next-Hop Configuration (optional)

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 next-hop recursive command followed by a set interface null0 configuration.

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

Prerequisites

If load sharing is required, CEF load sharing should be configured for per-packet or per-destination load sharing. Load balancing should be done over all equal-cost routes to the subnet that have been configured by the set next-hop recursive command.

This functionality should be available in centralized and distributed systems.

Restrictions

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

SUMMARY STEPS

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 recursive ip-address

7. match ip address access-list-number

8. exit

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3 

access-list permit source

Example:

Router(config)# access-list permit 10.60.0.0 0.0.255.255

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

Step 4 

route-map map-tag

Example:

Router(config)# route-map abccomp

Enables policy routing and enters route-map configuration mode.

Step 5 

set ip next-hop ip-address

Example:

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

Sets a next-hop router IP address.

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

Step 6 

set ip next-hop recursive ip-address

Example:

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

Sets a recursive next-hop IP address.

Note 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

Example:

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

Sets an access list to be matched.

Step 8 

exit

Example:

Router(config-route-map)# exit

Exits global configuration mode.

Verifying the Recursive Next-Hop Configuration

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

SUMMARY STEPS

1. show running-config | beg abccomp

2. show route-map abccomp

DETAILED STEPS


Step 1 show running-config | beg 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 | beg abccomp

route-map abccomp permit 10
 match ip address 101 ! Defines the match criteria for an access list.
 set ip next-hop recursive 10.3.3.3 ! If the match criteria is met, the recursive IP 
address is set.
 set ip next-hop 10.1.1.1 10.2.2.2 10.4.4.4

Step 2 show route-map abccomp

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 10.3.3.3
  ip next-hop 10.1.1.1 10.2.2.2 10.4.4.4
 Policy routing matches: 0 packets, 0 bytes

Configuration Examples for PBR Recursive Next Hop

This section provides the following configuration example:

Recursive Next-Hop IP Address: Example

Recursive Next-Hop IP Address: Example

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

route-map abccomp
 set ip next-hop 10.1.1.1
 set ip next-hop 10.2.2.2
 set ip next-hop recursive 10.3.3.3
 set ip next-hop 10.4.4.4

Additional References

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

Related Documents

Related Topic
Document Title

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

Cisco IOS IP Command Reference, Volume 2 of 4: Routing Protocols, Release 12.3T

Policy-based routing overview and configuration

" Configuring Policy-Based Routing" chapter in the Cisco IOS Quality of Service Solutions Configuration Guide, Release 12.2


MIBs

MIBs
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:

http://www.cisco.com/go/mibs


Technical Assistance

Description
Link

Technical Assistance Center (TAC) home page, containing 30,000 pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.

http://www.cisco.com/public/support/tac/home.shtml


Command Reference

This section documents modified commands only.

set ip next-hop

show route-map

set ip next-hop

To indicate where to output packets that pass a match clause of a route map for policy routing, use the set ip next-hop command in route-map configuration mode. To delete an entry, use the no form of this command.

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

no set ip next-hop ip-address [...ip-address]

Syntax Description

ip-address

IP address of the next hop to which packets are output. It must be the address of an adjacent router.

recursive ip-address

IP address of the recursive next-hop router.

Note The next-hop IP address must be assigned separately from the recursive next-hop IP address.


Defaults

This command is disabled by default.

Command Modes

Route-map configuration

Command History

Release
Modification

11.0

This command was introduced.

12.0(28)S

The recursive keyword was added.

12.3(14)T

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


Usage Guidelines

An ellipsis (...) in the command syntax indicates that your command input can include multiple values for the ip-address argument.

Use the ip policy route-map interface configuration command, the route-map global configuration command, and the match and set route-map configuration commands to define the conditions for policy routing packets. The ip policy route-map command identifies a route map by name. Each route-map command has a list of match and set commands associated with it. The match commands specify the match criteria—the conditions under which policy routing occurs. The set commands specify the set actions—the particular routing actions to perform if the criteria enforced by the match commands are met.

If the interface associated with the first next hop specified with the set ip next-hop command is down, the optionally specified IP addresses are tried in turn.

The set clauses can be used in conjunction with one another. They are evaluated in the following order:

1. set ip next-hop

2. set interface

3. set ip default next-hop

4. set default interface


Note The set ip next-hop and set ip default next-hop are similar commands but have a different order of operations. Configuring the set ip next-hop command causes the system to use policy routing first and then use the routing table. Configuring the set ip default next-hop command causes the system to use the routing table first and then policy route the specified next hop.


Examples

In the following example, packets with a Level 3 length of 3 to 50 bytes are output to the router at IP address 10.14.2.2:

interface serial 0
 ip policy route-map thataway
!
route-map thataway
 match length 3 50
 set ip next-hop 10.14.2.2

In the following example, the IP address of 10.3.3.3 is set as the recursive next-hop address:

route-map map_recurse
 set ip next-hop recursive 10.3.3.3

Related Commands

Command
Description

ip policy route-map

Identifies a route map to use for policy routing on an interface.

match ip address

Distributes any routes that have a destination network number address that is permitted by a standard or extended access list, and performs policy routing on packets.

match length

Bases policy routing on the Level 3 length of a packet.

route-map (IP)

Defines the conditions for redistributing routes from one routing protocol into another, or enables policy routing.

set default interface

Indicates where to output packets that pass a match clause of a route map for policy routing and have no explicit route to the destination.

set interface

Indicates where to output packets that pass a match clause of route map for policy routing.

set ip default next-hop verify-availability

Indicates where to output packets that pass a match clause of a route map for policy routing and for which the Cisco IOS software has no explicit route to a destination.


show route-map

To display static and dynamic route maps, use the show route-map command in privileged EXEC mode.

show route-map [map-name | dynamic [dynamic-map-name | application [application-name]] | all]

Syntax Description

map-name

(Optional) Name of a specific route map.

dynamic

(Optional) Displays dynamic route map information.

dynamic-map-name

(Optional) Name of a specific dynamic route map.

application

(Optional) Displays dynamic route maps based on applications.

application-name

(Optional) Name of a specific application.

all

(Optional) Displays all static and dynamic route maps.


Command Modes

Privileged EXEC

Command History

Release
Modification

10.0

This command was introduced.

12.0(22)S

An additional counter collect policy routing statistic was integrated in Cisco IOS Release 12.0(22)S.

12.2(15)T

An additional counter collect policy routing statistic was integrated in Cisco IOS Release 12.2(15)T.

12.3(7)T

The dynamic, application, and all keywords were added.

12.0(28)S

The support for recursive next-hop clause was added.

12.3(14)T

The support for recursive next-hop clause was integrated in Release 12.3(14)T.


Examples

show route-map Command with No Keywords Specified Example

The following is sample output from the show route-map command:

Router# show route-map

route-map sid, permit, sequence 10
Match clauses:
    tag 1 2
Set clauses:
    metric 5
route-map sid, permit, sequence 20
Match clauses:
    tag 3 4
Set clauses:
    metric 6
Policy routing matches: 0 packets; 0 bytes

The following example shows MPLS-related route map information:

Router# show route-map

route-map OUT, permit, sequence 10
Match clauses:
  ip address (access-lists): 1 
Set clauses:
  mpls label
Policy routing matches: 0 packets, 0 bytes
       
route-map IN, permit, sequence 10
Match clauses:
  ip address (access-lists): 2 
  mpls label
Set clauses:
Policy routing matches: 0 packets, 0 bytes

Table 1 describes the significant fields shown in the display.

Table 1 show route-map Field Descriptions 

Field
Description

route-map

Name of the route map.

permit

Indicates that the route is redistributed as controlled by the set actions.

sequence

Number that indicates the position a new route map is to have in the list of route maps already configured with the same name.

Match clauses
  tag

Match criteria—conditions under which redistribution is allowed for the current route map.

Set clauses
  metric

Set actions—the particular redistribution actions to perform if the criteria enforced by the match commands are met.

Policy routing matches

Number of packets and bytes that have been filtered by policy routing.


show route-map Command with Dynamic Route Map Specified Example

The following is sample output from the show route-map command when entered with the dynamic keyword:

Router# show route-map dynamic

route-map AAA-02/06/04-14:01:26.619-1-AppSpec, permit, sequence 0, identifier 1137954548
  Match clauses:
    ip address (access-lists): PBR#1 PBR#2 
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
route-map AAA-02/06/04-14:01:26.619-1-AppSpec, permit, sequence 1, identifier 1137956424
  Match clauses:
    ip address (access-lists): PBR#3 PBR#4 
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
route-map AAA-02/06/04-14:01:26.619-1-AppSpec, permit, sequence 2, identifier 1124436704
  Match clauses:
    ip address (access-lists): PBR#5 PBR#6 
    length 10 100
  Set clauses:
    ip next-hop 7.1.1.1
    ip gateway 7.1.1.1
  Policy routing matches: 0 packets, 0 bytes
Current active dynamic routemaps = 1

The following is sample output from the show route-map command when entered with the dynamic and application keywords:

Router# show route-map dynamic application

Application - AAA
  Number of active routemaps = 1

When you specify an application name, only dynamic routes for that application are shown. The following is sample output from the show route-map command when entered with the dynamic and application keywords and the AAA application name:

Router# show route-map dynamic application AAA

AAA
  Number of active rmaps = 2
AAA-02/06/04-14:01:26.619-1-AppSpec
AAA-02/06/04-14:34:09.735-2-AppSpec

Router# show route-map dynamic AAA-02/06/04-14:34:09.735-2-AppSpec

route-map AAA-02/06/04-14:34:09.735-2-AppSpec, permit, sequence 0, identifier 1128046100
  Match clauses:
    ip address (access-lists): PBR#7 PBR#8 
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
route-map AAA-02/06/04-14:34:09.735-2-AppSpec, permit, sequence 1, identifier 1141277624
  Match clauses:
    ip address (access-lists): PBR#9 PBR#10 
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
route-map AAA-02/06/04-14:34:09.735-2-AppSpec, permit, sequence 2, identifier 1141279420
  Match clauses:
    ip address (access-lists): PBR#11 PBR#12 
    length 10 100
  Set clauses:
    ip next-hop 7.1.1.1
    ip gateway 7.1.1.1
  Policy routing matches: 0 packets, 0 bytes
Current active dynamic routemaps = 2

In the following example, a recursive route-map has been configured for the route-map named abccomp:

Router# show route-map abccomp 

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

Related Commands

Command
Description

redistribute (IP)

Redistributes routes from one routing domain into another routing domain.

route-map (IP)

Defines the conditions for redistributing routes from one routing protocol into another, or enables policy routing.