06-Layer 3 - IP Routing Command Reference

HomeSupportRoutersH3C SR8800 Router SeriesReference GuidesCommand ReferencesH3C SR8800 Command Reference-Release3347-6W10306-Layer 3 - IP Routing Command Reference
07-Policy-Based Routing Commands
Title Size Download
07-Policy-Based Routing Commands 103.69 KB

apply access-vpn vpn-instance

Syntax

apply access-vpn vpn-instance vpn-instance-name

undo apply access-vpn vpn-instance [ vpn-instance-name ]

View

PBR policy node view

Default level

2: System level

Parameters

vpn-instance-name: Specifies an MPLS L3VPN. vpn-instance-name is a case-sensitive string of 1 to 31 characters.

Description

Use the apply access-vpn vpn-instance command to set one or multiple VPN instances.

Use the undo apply access-vpn vpn-instance command to remove one or multiple specified VPN instances.

 

 

NOTE:

·       The specified VPN instance(s) must exist.

·       You can set one VPN instance for a policy node.

 

Examples

# Set the VPN instance, vpn1, for forwarding packets.

<Sysname> system-view

[Sysname] policy-based-route policy1 permit node 10

[Sysname-pbr-policy1-10] apply access-vpn vpn-instance vpn1

apply ip-address default next-hop

Syntax

apply ip-address default next-hop ip-address [ track track-entry-number ] [ ip-address [ track track-entry-number ] ]

undo apply ip-address default next-hop [ ip-address [ ip-address ] ]

View

PBR policy node view

Default level

2: System level

Parameters

ip-address: IP address of the default next hop.

track track-entry-number: Specifies a track entry. The track-entry-number argument is in the range 1 to 1024.

Description

Use the apply ip-address default next-hop command to set the default next hop(s).

Use the undo apply ip-address default next-hop command to remove the configuration.

Note the following:

·           At most two default next hops can be specified in one command line.

·           Using the undo apply ip-address default next-hop command with a next hop specified removes the default next hop. Using this command without any next hop specified removes all default next hops.

Examples

# Set the default next hop to 1.1.1.1.

<Sysname> system-view

[Sysname] policy-based-route aa permit node 11

[Sysname-pbr-aa-11] apply ip-address default next-hop 1.1.1.1 track 1

apply ip-address next-hop

Syntax

apply ip-address next-hop ip-address [ direct ] [ track track-entry-number ] [ ip-address [ direct ] [ track track-entry-number ] ]

undo apply ip-address next-hop [ ip-address [ ip-address ] ]

View

PBR policy node view

Default level

2: System level

Parameters

ip-address: IP address of the next hop.

direct: Specifies the current next hop as valid when it is a directly connected next hop.

track track-entry-number: Specifies a track entry. The track-entry-number argument is in the range 1 to 1024.

Description

Use the apply ip-address next-hop command to set the next hop(s) for packets.

Use the undo apply ip-address next-hop command to remove the configuration.

You can specify up to two next hops in one command line for load sharing.

Using the undo apply ip-address next-hop command with a next hop specified removes the next hop. Using this command without any next hop specified removes all next hops.

Examples

# Set the directly connected next hop to 1.1.1.1.

<Sysname> system-view

[Sysname] policy-based-route aa permit node 11

[Sysname-pbr-aa-11] apply ip-address next-hop 1.1.1.1 direct

apply ip-precedence

Syntax

apply ip-precedence value

undo apply ip-precedence

View

PBR policy node view

Default level

2: System level

Parameters

value: Sets the precedence for IP packets. Eight precedence values (0 to 7) are available. Each precedence value corresponds to a precedence type, as shown in Table 1. You can set either a precedence value or a precedence type for IP packets.

Table 1 IP precedences and the corresponding types

Precedence value

Precedence type

0

routine

1

priority

2

immediate

3

flash

4

flash-override

5

critical

6

internet

7

network

 

Description

Use the apply ip-precedence command to set a precedence for packets.

Use the undo apply ip-precedence command to remove the configuration.

Examples

# Set the precedence to 5 (critical) for packets.

<Sysname> system-view

[Sysname] policy-based-route aa permit node 11

[Sysname-pbr-aa-11] apply ip-precedence critical

display ip policy-based-route

Syntax

display ip policy-based-route [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display ip policy-based-route command to display the PBR routing information.

Examples

# Display the PBR routing information.

<Sysname> display ip policy-based-route

Policy Name                interface

pr02                       local

pr02                       Virtual-Template0

pr01                       GigabitEthernet 3/1/1

Table 2 Output description

Field

Description

Policy Name

Policy name.

interface

PBR type.

This field displays local for a local PBR or a specific interface (such as Virtual-template 0) to which the policy has been applied to implement interface PBR.

 

display ip policy-based-route setup

Syntax

display ip policy-based-route setup { policy-name | interface interface-type interface-number [ slot slot-number ] | local [ slot slot-number ] } [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

policy-name: Displays the PBR routing information of the specified policy. A policy name is a string of 1 to 19 characters.

interface interface-type interface-number: Displays the PBR routing information on the specified interface.

local: Displays the local PBR information.

slot slot-number: Displays the PBR routing information on a card. slot-number represents the number of the slot that holds the card.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display ip policy-based-route setup command to display the specified PBR routing information.

Examples

# Display the PBR routing information of policy pr01.

<Sysname> display ip policy-based-route setup pr01

 policy Name             interface

 pr01                    GigabitEthernet3/1/1

# Display the PBR routing information on GigabitEthernet 3/1/1.

<Sysname> display ip policy-based-route setup interface GigabitEthernet3/1/1

 Interface GigabitEthernet3/1/1 policy based routing configuration information:

 policy-based-route: pr01

   permit node 1:

     if-match acl 3101

     apply ip-address next-hop 1.1.2.2

# Display the local PBR routing information.

<Sysname> display ip policy-based-route setup local

 Local policy based routing configuration information:

 policy-based-route: pr01

   permit node 1:

     if-match acl 3101

     apply ip-address next-hop 1.1.2.2

Table 3 Output description

Field

Description

policy Name

Policy name.

interface

Interface where the policy is applied. Local means the policy is applied locally.

Interface GigabitEthernet3/1/1 policy based routing configuration information

PBR routing information on GigabitEthernet 3/1/1.

Local policy based routing configuration information

Local PBR information.

policy-based-route

Policy name.

permit node 1

The match mode is permit, and the policy has a node (node 1).

if-match acl 3101

Match packets against ACL 3101.

apply ip-address next-hop 1.1.2.2

The next hop is 1.1.2.2.

 

display ip policy-based-route statistics

Syntax

display ip policy-based-route statistics { interface interface-type interface-number | local } [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

interface interface-type interface-number: Displays the statistics of PBR on the specified interface.

local: Displays the statistics of local PBR.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display ip policy-based-route statistics command to display PBR statistics.

Examples

# Display the statistics of PBR on GigabitEthernet 3/1/1.

<Sysname> display ip policy-based-route statistic interface GigabitEthernet 3/1/1

 Interface GigabitEthernet3/1/1 policy based routing statistics information:

 policy-based-route: aaa

   permit node 5:

     if-match acl 3101

     apply ip-address next-hop 1.1.2.2

   matched: 0

 Total matched: 0

Table 4 Output description

Field

Description

Interface GigabitEthernet3/1/1 policy based routing statistics information

PBR statistics on GigabitEthernet 3/1/1.

policy-based-route: aaa

The policy name is aaa.

permit node 5

The match mode of node 5 is permit.

apply ip-address next-hop 1.1.2.2

The next hop is 1.1.2.2.

matched: 0

Matching packets on node 5.

Total matched: 0

Total matching packets on all nodes.

 

display policy-based-route

Syntax

display policy-based-route [ policy-name ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

policy-name: Displays information about the specified policy. A policy name is a string of 1 to 19 characters.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display policy-based-route command to display PBR policy information.

If no policy name is specified, all PBR policy information is displayed. If a policy name is specified, information about the specified policy is displayed.

Examples

# Display the PBR policy information.

<Sysname> display policy-based-route

policy-based-route : aaa

    Node 5 permit :

       if-match acl 3101

       apply ip-address next-hop 1.1.2.2

Table 5 Output description

Field

Description

policy-based-route : aaa

The policy name is aaa.

Node  5  permit :

The matching mode of node 5 is permit.

if-match acl 3101

Match packets against ACL 3101.

apply ip-address next-hop 1.1.2.2

The next hop is 1.1.2.2.

 

if-match acl

Syntax

if-match acl acl-number

undo if-match acl

View

PBR policy node view

Default level

2: System level

Parameters

acl-number: ACL number, in the range of 2000 to 3999. The number of a basic ACL ranges from 2000 to 2999 and that of an advanced ACL ranges from 3000 to 3999.

Description

Use the if-match acl command to define an ACL match criterion.

Use the undo if-match acl command to remove the ACL match criterion.

Examples

# Permit the packets matching ACL 2010.

<Sysname> system-view

[Sysname] policy-based-route aa permit node 11

[Sysname-pbr-aa-11] if-match acl 2010

ip local policy-based-route

Syntax

ip local policy-based-route policy-name

undo ip local policy-based-route policy-name

View

System view

Default level

2: System level

Parameters

policy-name: Policy name, a string of 1 to 19 characters.

Description

Use the ip local policy-based-route command to configure local PBR based on a specified policy.

Use the undo ip local policy-based-route command to remove the configuration.

No policy is referenced for local PBR by default.

Only one policy can be referenced for local PBR.

Local PBR is used to route packets generated locally. Unless otherwise required, H3C does not recommend configuring local PBR.

Examples

# Configure local PBR based on policy aaa.

<Sysname> system-view

[Sysname] ip local policy-based-route aaa

ip policy-based-route

Syntax

ip policy-based-route policy-name

undo ip policy-based-route policy-name

View

Interface view

Default level

2: System level

Parameters

policy-name: Policy name, a string of 1 to 19 characters.

Description

Use the ip policy-based-route command to configure PBR on the interface.

Use the undo ip policy-based-route command to remove the configuration.

No policy is referenced for interface PBR by default.

Note the following:

·           Only one policy can be referenced by an interface for PBR.

·           The referenced policy applies to all packets arriving on the interface.

Examples

# Configure PBR based on policy aaa on GigabitEthernet 3/1/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet 3/1/1

[Sysname-GigabitEthernet3/1/1] ip policy-based-route aaa

policy-based-route

Syntax

policy-based-route policy-name [ deny | permit ] node node-number

undo policy-based-route policy-name [ deny | node node-number | permit ]

View

System view

Default level

2: System level

Parameters

policy-name: Policy name, a string of 1 to 19 characters.

deny: Specifies the match mode of the policy node as deny.

permit: Specifies the match mode of the policy node as permit.

node node-number: Number of a policy node, in the range of 0 to 65535. A node with a smaller node-number has a higher match priority than a node with a greater one.

Description

Use the policy-based-route command to create a policy, policy node, or both, and enter PBR policy node view.

Use the undo policy-based-route command to remove a created policy or policy node.

No policy or policy node is created by default.

The default match mode of a policy node is permit.

Examples

# Configure the match mode of node 10 of policy 1 as permit, and enter PBR policy node view.

<Sysname> system-view

[Sysname] policy-based-route policy1 permit node 10

[Sysname-pbr-policy1-10]

reset policy-based-route statistics

Syntax

reset policy-based-route statistics [ policy-name ]

View

User view

Default level

1: Monitor level

Parameters

policy-name: Policy name, a string of 1 to 19 characters.

Description

Use the reset policy-based-route statistics command to clear PBR statistics.

If no policy name is specified, this command clears all the PBR statistics.

Examples

# Clear all PBR statistics.

<Sysname> reset policy-based-route statistics

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网