pbr-action-list

Syntax

pbr-action-list[] {nexthop | default-nexthop}interface {null |} no [] {nexthop | default-nexthop}interface {null |} no pbr-action-list

Description

Creates a PBR action list or modifies its entries.

Thenoform of this command can be used to delete an action list or an individual action list entry.

Command context

config

Thepbr-action-listcommand takes you into theconfig-pbr-action-list-context where you modify entries for a PBR action list.

Parameters

Specifies the action list name. An action list name can be 1 to 64 alphanumeric characters.

Specifies list entry sequence number. Range: 1-4294967295

{nexthop | default-nexthop}

Selects a regular next-hop (nexthop) or a default next-hop (default-nexthop). These parameters specify the address of a next-hop router to forward traffic matched by a class under different conditions.

nexthop

Sets the next hop for routing the packet.

default-nexthop

Sets the next hop for routing the packet when there is no explicit route for its destination.

Specifies IPv4 or IPv6 address of the next-hop router.

interface {null |

Selects the type of keyword interface:nullor the tunnel interface name.

null

Specifies to drop matching traffic.

Specifies an IP tunnel interface name through which to forward the matching traffic.

Authority

Administrators or local user group members with execution rights for this command.

Restrictions

下一跳的可达性routers/tunnel interfaces in the list is not guaranteed. Such reachability can change at any time due to the dynamic nature of the network environment.

Usage

Each action list may contain up to eight entries of four different entry types:
  • interface null

  • interface tunnel

  • nexthop

  • default-nexthop

List entries have a unique sequence number which, if not user specified, are automatically assigned beginning at 10 and continuing at intervals of 10 for each subsequent new list entry, for example 20, 30, and 40. Sequence numbers of any value can be specified manually, a different interval may be set, and new entries can be added to (or removed from) any location in the list at any time.

Specifying an existing sequence number causes the existing list entry to be replaced by the new details. The list entry with the lowest sequence number has the highest priority entry in the list. The sequence numbers may be renumbered with thepbr-action-list resequencecommand.

Only one next-hop router or interface from the list is used per packet matched. This router or interface is defined as the highest priority list entry that is reachable or available at the time of the traffic match. If the highest priority list entry next-hop router or tunnel interface is reachable - that list entry is chosen, the search is stopped - and the traffic is forwarded to the next-hop router or interface for the entry. If the highest priority list entry next-hop router or tunnel interface is not reachable, the next highest priority list entry reachability is determined and used if reachable, otherwise the process continues down the list. If none of the routers in the list are reachable, the packet may be dropped through the null interface entry if configured) or forwarded according to a system route table entry.

NOTE:

An action list that contains a next-hop of one IP version cannot also contain an entry of another IP version. For example, an action list must contain only IPv4 or IPv6 next-hop addresses or tunnel interfaces.

Examples

The list name is included in the context prompt for easy current-list identification. Any list name over 10 characters will be truncated at 10 characters and terminated with the tilde character (~) to indicate a reduced list name display. This reduction affects the prompt display of the list name only:

switch(config)#pbr-action-list eighteencharsswitch(config-pbr-action-list-eighteench~)#

The following example creates an action list with two IPv4 next-hops, a default IPv4 next-hop, and a null interface. The example uses default sequence numbering for its list entries.

switch(config)#pbr-action-list test1switch(config-pbr-action-list-test1)#nexthop 1.1.1.1switch(config-pbr-action-list-test1)#nexthop 2.2.2.2switch(config-pbr-action-list-test1)#default-nexthop9.9.9.9switch(config-pbr-action-list-test1)#interface nullswitch(config-pbr-action-list-test1)#endswitch(config)#show pbr-action-list test1Name Sequence Type Address/Interface ------------------------------------------------------------------ test1 10 nexthop 1.1.1.1 20 nexthop 2.2.2.2 30 default-nexthop 9.9.9.9 40 interface null

The following example creates an action list with an IPv4 next-hop and a tunnel interface with manual sequence numbers for its entries.

switch(config)#pbr-action-list test2switch(config-pbr-action-list-test2)#6 ip default-nexthop 4.4.4.4switch(config-pbr-action-list-test2)#1 interface tunnel10switch(config-pbr-action-list-test2)#endswitch(config)#show pbr-action-list test2Name Sequence Type Address/Interface ------------------------------------------------------------------ test2 1 interface tunnel10 6 default-nexthop 4.4.4.4

The following example creates an action list with two IPv4 tunnel interfaces, with default sequence numbering.

switch(config)#pbr-action-list test3switch(config-pbr-action-list-test3)#interface tunnel10switch(config-pbr-action-list-test3)#interface tunnel15switch(config-pbr-action-list-test3)#endswitch(config)#show pbr-action-list test3Name Sequence Type Address/Interface ------------------------------------------------------------------ test3 10 interface tunnel10 20 interface tunnel15

The following example creates an action list with two IPv6 next-hops and the null interface, with manual sequence numbers.

switch(config)#pbr-action-list test4switch(config-pbr-action-list-test4)#5 nexthop 2000:abcd::cccc:ddddswitch(config-pbr-action-list-test4)#6 nexthop 1000:abcd::1234:5678switch(config-pbr-action-list-test4)#7界面为空switch(config-pbr-action-list-test4)#endswitch(config)#show pbr-action-list test4Name Sequence Type Address/Interface ------------------------------------------------------------------ test4 5 nexthop 2000:abcd::cccc:dddd 6 nexthop 1000:abcd::1234:5678 7 interface null