- Table of Contents
-
- 07-Layer 3 - IP Routing Command Reference
- 00-Preface
- 01-Basic IP Routing Commands
- 02-Static Routing Commands
- 03-RIP Commands
- 04-OSPF Commands
- 05-IS-IS Commands
- 06-BGP Commands
- 07-Policy-Based Routing Commands
- 08-Guard Route Commands
- 09-IPv6 Static Routing Commands
- 10-RIPng Commands
- 11-OSPFv3 Commands
- 12-IPv6 IS-IS Commands
- 13-IPv6 BGP Commands
- 14-IPv6 Policy-Based Routing Commands
- 15-Routing Policy Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
14-IPv6 Policy-Based Routing Commands | 99.69 KB |
Contents
IPv6 policy-based routing configuration commands
display ipv6 config policy-based-route
display ipv6 policy-based-route
display ipv6 policy-based-route setup
display ipv6 policy-based-route statistics
ipv6 policy-based-route (interface view)
ipv6 policy-based-route (system view)
reset ipv6 policy-based-route statistics
|
NOTE: The switch operates in IRF or standalone (the default) mode. For information about the IRF mode, see IRF Configuration Guide. |
apply ipv6-address next-hop
Syntax
apply ipv6-address next-hop ipv6-address
undo apply ipv6-address next-hop [ ipv6-address ]
View
IPv6 PBR policy node view
Default level
2: System level
Parameters
ipv6-address: IPv6 address of the next hop.
Description
Use the apply ipv6-address next-hop command to set a next hop.
Use the undo apply ipv6-address next-hop command to remove the next hop.
The next hop must be adjacent to the switch.
You can specify up to two next hops for a policy by executing the apply ipv6-address next-hop command twice.
If you configure two next hops for IPv6 interface PBR at the same time, only the primary next hop takes effect. The backup next hop takes effect only when the primary next hop is invalid. When neither next hop takes effect, packets are forwarded according to the routing table.
If you configure two next hops for IPv6 local PBR at the same time, both next hops take effect to implement load sharing.
Using the undo apply ipv6-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 a next hop of 1::1 for IPv6 packets.
<Sysname> system-view
[Sysname] ipv6 policy-based-route aa permit node 11
[Sysname-pbr6-aa-11] apply ipv6-address next-hop 1::1
apply ipv6-precedence
Syntax
apply ipv6-precedence { type | value }
undo apply ipv6-precedence
View
IPv6 PBR policy node view
Default level
2: System level
Parameters
type: Sets a preference type.
value: Sets a preference value from 0 to 7 (inclusive). Each value corresponds to a keyword, as shown in the following table.
Table 1 Preferences and the corresponding keywords
Preference value |
Keyword |
0 |
routine |
1 |
priority |
2 |
immediate |
3 |
flash |
4 |
flash-override |
5 |
critical |
6 |
internet |
7 |
network |
Description
Use the apply ipv6-precedence command to set a preference or preference type for IPv6 packets.
Use the undo apply ipv6-precedence command to remove the clause.
Examples
# Set a preference of 5 (critical).
<Sysname> system-view
[Sysname] ipv6 policy-based-route aa permit node 11
[Sysname-pbr6-aa-11] apply ipv6-precedence critical
display ipv6 config policy-based-route
Syntax
In standalone mode:
display ipv6 config policy-based-route [ policy-name [ slot slot-number ] ] [ | { begin | exclude | include } regular-expression ]
In IRF mode:
display ipv6 config policy-based-route [ policy-name [ chassis chassis-number slot slot-number ] ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
policy-name: Policy name, a string of 1 to 19 characters.
slot slot-number: Specifies a card by its slot number.
chassis chassis-number slot slot-number: Specifies a card on an IRF member switch. The chassis-number argument represents the ID of the IRF member switch, and the slot-number argument 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 ipv6 config policy-based-route command to display the IPv6 PBR policy information.
If no policy name is specified, all the IPv6 PBR policy information is displayed. If a policy name is specified, information about the specified policy is displayed.
If no slot number is specified, the IPv6 PBR policy information on the AMB is displayed, as long as the policies are defined. If a slot number is specified, the IPv6 PBR policy information on the specified card is displayed, only when the policies are applied to the system or an interface of the specified card.
If no chassis chassis-number slot slot-number is specified, the IPv6 PBR policy information on the AMB of the master in an IRF fabric is displayed, as long as the policies are defined. If the chassis chassis-number slot slot-number is specified, the IPv6 PBR policy information on the specified card of the specified member switch is displayed only when the policies are applied to the system or an interface of the specified card.
Examples
# Display all IPv6 PBR policy information in standalone mode.
<Sysname> display ipv6 config policy-based-route
Interface Policy based routing configuration information:
policy-based-route : pbr6-1
Node 10 permit :
if-match acl6 3333
apply ipv6-address next-hop
2000::1
# Display the IPv6 PBR policy information of slot 4 on chassis 1. (IRF mode)
<Sysname> display ipv6 config policy-based-route pbr6-1 chassis 1 slot 4
Interface policy-based-route : pbr6-1
Node 10 permit :
if-match acl6 3000
apply ipv6-address next-hop
2002::1
Table 2 Output description
Field |
Description |
IPv6 Policy based routing configuration information |
IPv6 policy information. |
policy-based-route: pbr6-1 |
Name of the referenced policy. |
Node 10 permit : |
The matching mode of Node 10 is permit. |
apply ipv6-address next-hop |
IPv6 address of the next hop specified for the matched packets. |
display ipv6 policy-based-route
Syntax
display ipv6 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 ipv6 policy-based-route command to display the IPv6 PBR routing information.
Examples
# Display the IPv6 PBR routing information.
<Sysname> display ipv6 policy-based-route
Policy Name interface
pr02 local
pr01 GigabitEthernet 3/0/1
Table 3 Output description
Field |
Description |
Policy Name |
Routing policy name. |
Local |
Local PBR. |
GigabitEthernet3/0/1 |
Policy pr01 is applied to GigabitEthernet 3/0/1 to implement IPv6 PBR. |
display ipv6 policy-based-route setup
Syntax
Standalone mode:
display ipv6 policy-based-route setup { policy-name | interface interface-type interface-number [ slot slot-number ] | local [ slot slot-number ] } [ | { begin | exclude | include } regular-expression ]
IRF mode:
display ipv6 policy-based-route setup { policy-name | interface interface-type interface-number [ chassis chassis-number slot slot-number ] | local [ chassis chassis-number slot slot-number ] } [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
policy-name: Policy name, a string of 1 to 19 characters.
interface interface-type interface-number: Displays the IPv6 PBR routing information on the specified interface.
local: Displays the IPv6 local PBR information.
slot slot-number: Displays the IPv6 PBR routing information on a card. slot-number represents the number of the slot that holds the card.
chassis chassis-number slot slot-number: Displays the IPv6 PBR routing information of a card on an IRF member device. chassis-number represents the ID of the IRF member device, and slot-number argument 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 ipv6 policy-based-route setup command to display the specified IPv6 PBR routing information.
Examples
# Display the IPv6 PBR routing information of policy test.
<Sysname> display ipv6 policy-based-route setup test
policy Name interface
test local
# Display the IPv6 PBR routing information on interface VLAN-interface 20.
<Sysname> display ipv6 policy-based-route setup interface Vlan-interface 20
Interface Vlan-interface 20 policy based routing configuration information:
policy-based-route: test
permit node 6:
if-match acl6 2000
apply ipv6-address next-hop
1::1
# Display the IPv6 local PBR information.
<Sysname> display ipv6 policy-based-route setup local
Local policy based routing configuration information:
policy-based-route: test
permit node 6:
if-match acl6 3000
apply ipv6-address next-hop
1::1
Table 4 Output description
Description |
|
policy Name |
Policy name. |
interface |
Interface where the policy is applied. Local means the policy is applied locally. |
Interface Vlan-interface 20 policy based routing configuration information |
IPv6 PBR routing information on interface VLAN-interface 20. |
Local policy based routing configuration information |
IPv6 local PBR information. |
policy-based-route |
Name of the referenced policy. |
permit node 6 |
The match mode of Node 6 is permit. |
if-match acl6 3000 |
IPv6 packets matching IPv6 ACL 3000 are permitted. |
apply ipv6-address next-hop |
Specify a next hop for permitted IPv6 packets. |
display ipv6 policy-based-route statistics
Syntax
In standalone mode:
display ipv6 policy-based-route statistics { interface interface-type interface-number | local } [ slot slot-number ] [ | { begin | exclude | include } regular-expression ]
In IRF mode:
display ipv6 policy-based-route statistics { interface interface-type interface-number | local } [ chassis chassis-number slot slot-number ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
interface interface-type interface-number: Displays IPv6 PBR statistics on the specified interface.
local: Displays IPv6 local PBR statistics.
slot slot-number: Specifies a card by its slot number.
chassis chassis-number slot slot-number: Specifies a card on an IRF member switch. The chassis-number argument represents the ID of the IRF member switch, and the slot-number argument 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 ipv6 policy-based-route statistics command to display IPv6 PBR statistics.
Examples
# Display IPv6 local PBR statistics.
<Sysname> display ipv6 policy-based-route statistics local
Local policy based routing statistics information:
ipv6 policy-based-route: tang
permit node 1:
if-match acl6 3106
apply ipv6-precedence flash
apply ipv6-address next-hop
2::2:2
matched: 0
Total matched: 0
Table 5 Output description
Field |
Description |
Local policy based routing information |
Local PBR information |
ipv6 policy-based-route |
Name of the referenced policy |
permit node |
The matching mode of the node is permit. |
if-match acl6 3106 |
Match IPv6 packets against ACL 3106 |
apply ipv6-precedence flash |
Precedence specified for matching IPv6 packets |
apply ipv6-address next-hop 2::2:2 |
Next hop specified for matching IPv6 packets |
matched |
Total number of matching packets on the node |
Total matched |
Total number of matching packets on all nodes |
if-match acl6
Syntax
if-match acl6 acl6-number
undo if-match acl6
View
IPv6 PBR policy node view
Default level
2: System level
Parameters
acl6-number: IPv6 ACL number, in the range of 2000 to 3999. The number of a basic IPv6 ACL ranges from 2000 to 2999 and that of an advanced IPv6 ACL ranges from 3000 to 3999.
Description
Use the if-match acl6 command to define an IPv6 ACL match criterion.
Use the undo if-match acl6 command to remove the IPv6 ACL match criterion.
Examples
# Permit the packets matching ACL 2000.
<Sysname> system-view
[Sysname] ipv6 policy-based-route aa permit node 10
[Sysname-pbr6-aa-10] if-match acl6 2000
ipv6 local policy-based-route
Syntax
ipv6 local policy-based-route policy-name
undo ipv6 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 ipv6 local policy-based-route command to configure IPv6 local PBR based on a policy.
Use the undo ipv6 local policy-based-route command to remove the configuration.
IPv6 local PBR is not configured by default.
Local PBR is used to route packets generated locally. Unless otherwise required, you are not recommended to configure local PBR.
Examples
# Configure IPv6 local PBR based on policy AAA.
<Sysname> system-view
[Sysname] ipv6 local policy-based-route AAA
ipv6 policy-based-route (interface view)
Syntax
ipv6 policy-based-route policy-name
undo ipv6 policy-based-route
View
Interface view
Default level
2: System level
Parameters
policy-name: Policy name, a string of 1 to 19 characters.
Description
Use the ipv6 policy-based-route command to configure IPv6 PBR based on a policy on the interface.
Use the undo ipv6 policy-based-route command to remove the configuration.
IPv6 interface PBR is not configured by default.
Examples
# Define IPv6 PBR based on policy BBB on VLAN-interface 2.
<Sysname> system-view
[Sysname] vlan 2
[Sysname-Vlan2] interface vlan-interface 2
[Sysname-Vlan-interface2] ipv6 policy-based-route BBB
ipv6 policy-based-route (system view)
Syntax
ipv6 policy-based-route policy-name [ deny | permit ] node node-number
undo ipv6 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—the default match mode.
node node-number: Number of the IPv6 policy node, in the range of 0 to 65535. Packets will match against the node with a smaller node-number first.
Description
Use the ipv6 policy-based-route command to create an IPv6 policy or/and policy node and enter IPv6 PBR policy node view.
Use the undo ipv6 policy-based-route command to remove an IPv6 policy or/and policy node.
No IPv6 policy or policy node is created by default.
The default match mode of a policy node is permit.
If multiple nodes are defined for a policy, the match mode of at least one node must be permit.
Examples
# Create node 10 of IPv6 policy aaa with match mode being permit and enter IPv6 PBR policy node view.
<Sysname> system-view
[Sysname] ipv6 policy-based-route aaa permit node 10
[Sysname-pbr6-aaa-10]
reset ipv6 policy-based-route statistics
Syntax
reset ipv6 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 ipv6 policy-based-route statistics command to clear IPv6 PBR statistics.
If no policy name is specified, this command clears all IPv6 PBR statistics.
Examples
# Clear all IPv6 PBR statistics.
<Sysname> reset ipv6 policy-based-route statistics