- Table of Contents
-
- 05-Layer 3—IP Routing Command Reference
- 00-Preface
- 01-Basic IP routing commands
- 02-Static routing commands
- 03-RIP commands
- 04-OSPF commands
- 05-Policy-based routing commands
- 06-IPv6 static routing commands
- 07-RIPng commands
- 08-OSPFv3 commands
- 09-IPv6 policy-based routing commands
- 10-Routing policy commands
- Related Documents
-
Title | Size | Download |
---|---|---|
10-Routing policy commands | 199.61 KB |
Common routing policy commands
route-policy-change delay-time
if-match ipv6 even-prefix-length
if-match ipv6 odd-prefix-length
Routing policy commands
Common routing policy commands
apply cost
Use apply cost to set a cost for routes.
Use undo apply cost to restore the default.
Syntax
apply cost [ + | - ] cost-value
undo apply cost
Default
No cost is set for routes.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
+: Increases a cost value.
-: Decreases a cost value.
cost-value: Specifies a cost in the range of 0 to 4294967295.
Examples
# Configure node 10 in permit mode for routing policy policy1 to set a cost of 120 for OSPF external routes.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match route-type external-type1or2
[Sysname-route-policy-policy1-10] apply cost 120
apply cost-type
Use apply cost-type to set a cost type for routes.
Use undo apply cost-type to restore the default.
Syntax
apply cost-type { type-1 | type-2 }
undo apply cost-type
Default
No cost type is set for routes.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
type-1: Sets the cost type to OSPF Type-1 external route.
type-2: Sets the cost type to OSPF Type-2 external route.
Examples
# Configure node 10 in permit mode for routing policy policy1 to set the cost type for routes that have a tag of 8 to OSPF Type-1 external routes.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match tag 8
[Sysname-route-policy-policy1-10] apply cost-type type-1
apply ip-precedence
Use apply ip-precedence to set an IP precedence for matching routes.
Use undo apply ip-precedence to restore the default.
Syntax
apply ip-precedence { value | clear }
undo apply ip-precedence
Default
No IP precedence is set.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
value: Specifies an IP precedence in the range of 0 to 7.
clear: Clears the IP precedence of matching routes.
Examples
# Configure node 10 in permit mode for routing policy policy1 to set an IP precedence of 3 for routes matching prefix list 100.
<Sysname> system-view
[Sysname] ip prefix-list 100 permit 192.168.10.1 24
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match ip address prefix-list 100
[Sysname-route-policy-policy1-10] apply ip-precedence 3
apply preference
Use apply preference to set a preference for a routing protocol.
Use undo apply preference to restore the default.
Syntax
apply preference preference
undo apply preference
Default
No preference is set for a routing protocol.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
preference: Specifies a preference in the range of 1 to 255.
Usage guidelines
If you have set preferences for routing protocols by using the preference command, the apply preference command sets a new preference for the matching routing protocol. Unmatched routing protocols still use the preferences set by using the preference command.
Examples
# Configure node 10 in permit mode for routing policy policy1 to set the preference for OSPF external routes to 90.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match route-type external-type1or2
[Sysname-route-policy-policy1-10] apply preference 90
apply prefix-priority
Use apply prefix-priority to set a prefix priority for routes.
Use undo apply prefix-priority to restore the default.
Syntax
apply prefix-priority { critical | high | medium }
undo apply prefix-priority
Default
No prefix priority is set, which means the prefix priority is low.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
critical: Sets the critical prefix priority for routes.
high: Sets the high prefix priority for routes.
medium: Sets the medium prefix priority for routes.
Examples
# Configure node 10 in permit mode for routing policy policy1 to set prefix priority critical for routes matching prefix list abc.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match ip address prefix-list abc
[Sysname-route-policy-policy1-10] apply prefix-priority critical
apply qos-local-id
Use apply qos-local-id to set a local QoS ID for matching routes.
Use undo apply qos-local-id to restore the default.
Syntax
apply qos-local-id { local-id-value | clear }
undo apply qos-local-id
Default
No local QoS ID is set.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
local-id-value: Specifies a local QoS ID in the range of 1 to 4095.
clear: Clears the local QoS ID of matching routes.
Examples
# Configure node 10 in permit mode for routing policy policy1 to set a local QoS ID of 100 for routes matching prefix list 100.
<Sysname> system-view
[Sysname] ip prefix-list 100 permit 192.168.10.1 24
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match ip address prefix-list 100
[Sysname-route-policy-policy1-10] apply qos-local-id 100
apply tag
Use apply tag to set a tag for IGP routes.
Use undo apply tag to restore the default.
Syntax
apply tag tag-value
undo apply tag
Default
No routing tag is set for IGP routes.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
tag-value: Specifies the tag value in the range of 0 to 4294967295.
Examples
# Configure node 10 in permit mode for routing policy policy1 to set a tag of 100 for IGP routes.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] apply tag 100
continue
Use continue to specify the next node to be matched.
Use undo continue to restore the default.
Syntax
continue [ node-number ]
undo continue
Default
No next node is specified.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
node-number: Specifies the routing policy node number in the range of 0 to 65535.
Usage guidelines
The specified next node must have a larger number than the current node.
Example
# Specify the next node 20 for node 10 of the routing policy policy1.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] continue 20
display ip rd-list
Use display ip rd-list to display route distinguisher (RD) list information.
Syntax
display ip rd-list [ rd-list-number ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
rd-list-number: Displays information about an RD list. The rd-list-number argument represents the number of the RD list, in the range of 1 to 65535. If you do not specify an RD list, this command displays information about all RD lists.
Examples
# Display information about all RD lists.
<Sysname> display ip rd-list
Route Distinguisher List Number 1
index: 1 Permit 1.1.1.1:1 2.2.2.2:* 100:1 200:*
Route Distinguisher List Number 2
index: 2 Deny 1:1 2:2
Table 1 Command output
Field |
Description |
Route Distinguisher List Number |
RD list number. |
index |
Index of the RD list item. |
Permit |
Match mode: · Permit. · Deny. |
Related commands
ip rd-list
display route-policy
Use display route-policy to display routing policy information.
Syntax
display route-policy [ name route-policy-name ]
Views
Predefined user roles
network-admin
network-operator
Parameters
name route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters. If you do not specify this option, the command displays information about all routing policies.
Examples
# Display information about routing policy policy1.
<Sysname> display route-policy name policy1
Route-policy: policy1
Permit : 1
if-match cost 10
if-match as-path www
continue: next node 11
apply preference 10
Table 2 Command output
Field |
Description |
Route-policy |
Routing policy name. |
permit |
Match mode: · Permit. · Deny. |
if-match |
Match criterion. |
continue |
Specify the next node to be matched. |
apply |
Action. |
if-match cost
Use if-match cost to match routes that have the specified cost.
Use undo if-match cost to restore the default.
Syntax
if-match cost cost-value
undo if-match cost
Default
No cost match criterion is configured.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
cost-value: Specifies a cost in the range of 0 to 4294967295.
Examples
# Configure node 10 in permit mode for routing policy policy1 to permit routes with a cost of 8.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match cost 8
if-match interface
Use if-match interface to match routes that have the specified output interfaces.
Use undo if-match interface to remove the specified output interface match criterion.
Syntax
if-match interface { interface-type interface-number }&<1-16>
undo if-match interface [ interface-type interface-number ]&<1-16>
Default
No output interface match criterion is configured.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
interface-type interface-number: Specifies an interface by its type and number.
&<1-16>: Indicates that you can specify a maximum of 16 interfaces.
Examples
# Configure node 10 in permit mode for routing policy policy1 to permit routes with the output interface VLAN-interface 1.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match interface vlan-interface 1
if-match rd-list
Use if-match rd-list to match routes whose RD matches the specified RD list.
Use undo if-match rd-list to remove the specified RD list match criterion.
Syntax
if-match rd-list rd-list-number
undo if-match rd-list
Default
No RD list match criterion is configured.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
rd-list-number: Specifies an RD list by its number in the range of 1 to 65535.
Examples
# Configure node 10 in permit mode for routing policy rp1 to match routes whose RD matches RD list 1..
<Sysname> system-view
[Sysname] ip rd-list 1 permit 1:1
[Sysname] route-policy rp1 permit node 10
[Sysname-route-policy-rp1-10] if-match rd-list 1
Related commands
ip rd-list
if-match route-type
Use if-match route-type to set a route-type match criterion.
Use undo if-match route-type to remove the specified route-type match criterion.
Syntax
if-match route-type { external-type1 | external-type1or2 | external-type2 | internal | nssa-external-type1 | nssa-external-type1or2 | nssa-external-type2 } *
undo if-match route-type [ external-type1 | external-type1or2 | external-type2 | internal | nssa-external-type1 | nssa-external-type1or2 | nssa-external-type2 ] *
Default
No route-type match criterion is set.
Views
Predefined user roles
network-admin
Parameters
external-type1: Matches OSPF Type 1 external routes.
external-type1or2: Matches OSPF Type 1 and Type 2 external routes.
external-type2: Matches OSPF Type 2 external routes.
internal: Matches OSPF internal routes (including OSPF intra-area and inter-area routes).
nssa-external-type1: Matches OSPF NSSA Type 1 external routes.
nssa-external-type1or2: Matches OSPF NSSA Type 1 and 2 external routes.
nssa-external-type2: Matches OSPF NSSA Type 2 external routes.
Examples
# Configure node 10 in permit mode for routing policy policy1 to match OSPF internal routes.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match route-type internal
if-match tag
Use if-match tag to match IGP routes that have the specified tag.
Use undo if-match tag to restore the default.
Syntax
if-match tag tag-value
undo if-match tag
Default
No tag match criterion is configured.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
tag-value: Specifies a tag in the range of 0 to 4294967295.
Examples
# Configure node 10 in permit mode for routing policy policy1 to match IGP routes that have a tag of 8.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match tag 8
ip rd-list
Use ip rd-list configure an RD list.
Use undo ip rd-list to remove an RD list.
Syntax
ip rd-list rd-list-number [ index index-number ] { deny | permit } route-distinguisher&<1-10>
undo ip rd-list rd-list-number [ index index-number ] [ { deny | permit } route-distinguisher&<1-10> ]
Default
No RD lists exist.
Views
System view
Predefined user roles
network-admin
Parameters
rd-list-number: Specifies an RD list by its number in the range of 1 to 65535.
index index-number: Specifies an index number for an RD list item, in the range of 1 to 4294967295. An item with a smaller index number is matched first. If you do not specify this option, the index number starts from 10 and increases by 10 for each of the consecutive RD list items.
deny: Specifies the deny mode. If a route matches the item, the route is denied without being compared with the next item. If a route does not match the item, the route is compared with the next item.
permit: Specifies the permit mode. If a route matches the item, it passes the RD list. If a route does not match the item, the route is compared with the next item.
route-distinguisher&<1-10>: Specifies a list of up to 10 RD list items. Each item is a string of 3 to 21 characters.
An RD has the following forms:
· 16-bit AS number:32-bit self-defined number. For example, 101:3.
· 16-bit AS number:wildcard character. For example, 101:*.
· 32-bit IP address:16-bit self-defined number. For example, 192.168.122.15:1.
· 32-bit IP address:wildcard character. For example, 192.168.122.15:*.
· 32-bit AS number:16-bit self-defined number. For example, 65536:1. The minimum AS number is 65536.
· 32-bit AS number:wildcard character. For example, 65536:*. The minimum AS number is 65536.
Usage guidelines
An RD list matches the RDs of BGP routes. An RD list is identified by an RD list number and can contain multiple items that specify RD ranges. The relationship between the items is logical OR. A route matches the RD list if it matches one item in the list. A route does not match the RD list if it does not match any items in the list.
To filter routes by RD, use the ip rd-list command together with the if-match rd-list command. If you specify a nonexistent RD list for the if-match rd-list command, all routes pass the RD match criterion.
Examples
# Configure RD list 1 to permit routes with RD 100: 1.
<Sysname> system-view
[Sysname] ip rd-list 1 permit 100:1
Related commands
display ip rd-list
if-match rd-list
route-policy
Use route-policy to create a routing policy and a node and enter routing policy node view, or enter the view of an existing routing policy node.
Use undo route-policy to remove a routing policy or a node of it.
Syntax
route-policy route-policy-name { deny | permit } node node-number
undo route-policy route-policy-name [ deny | permit ] [ node node-number ]
Default
No routing policies exist.
Views
System view
Predefined user roles
network-admin
Parameters
route-policy-name: Specifies a routing policy name, a case-sensitive string of 1 to 63 characters.
deny: Specifies the deny match mode for the routing policy node. If a route matches all the if-match clauses of the node, it is denied without being compared with the next node. If a route does not match any if-match clauses of the node, the route is compared with the next node.
permit: Specifies the permit match mode for the routing policy node. If a route matches all the if-match clauses of the node, it is handled by the apply clauses of the node. If a route does not match any if-match clauses of the node, the route is compared with the next node.
node node-number: Specifies a node number in the range of 0 to 65535. A node with a smaller number is matched first.
Usage guidelines
Use a routing policy to filter routing information. A routing policy can contain several nodes and each node contains a set of if-match and apply clauses. The if-match clauses define the match criteria of the node and the apply clauses define the actions to be taken on packets matching the criteria. The relation between the if-match clauses of different types is logical AND and the relation between the if-match clauses of the same type is logical OR. if-match clauses of all types must be met. The relation between nodes is logical OR. A packet passing a node passes the routing policy. If a packet does not pass any nodes, the packet does not pass the routing policy.
Examples
# Create node 10 in permit mode for routing policy policy1 and enter routing policy node view.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10]
Related commands
display route-policy
route-policy-change delay-time
Use route-policy-change delay-time to set the routing policy change delay timer.
Use undo route-policy-change delay-time to restore the default.
Syntax
route-policy-change delay-time { time-value | unlimited }
undo route-policy-change delay-time
Default
Routing policy changes immediately take effect, but the routing protocol waits five seconds before processing routes from the new routing policy.
Views
System view
Predefined user roles
network-admin
Parameters
time-value: Specifies the routing policy change delay timer in the range of 60 to 3600 seconds. When this delay timer expires, the routing protocol waits five seconds before processing routes from the new routing policy.
unlimited: Sets an infinite delay timer.
Usage guidelines
This command makes a routing policy take effect after a delayed time interval, which prevents incomplete routing policy configuration from being issued to cause incorrect route advertisement. The system automatically starts the timer when a routing policy changes. The changes will not take effect on the routing policy until the change delay timer expires.
A routing policy changes when one of the following events occurs:
· A routing policy is created.
· A routing policy node, if-match clause, or apply clause is added, modified, or deleted for a routing policy.
· An IPv4 prefix list or IPv6 prefix list is added, modified, or deleted.
· The ACL used by an if-match clause changes.
To have enough time to complete routing policy configuration, you can specify the unlimited keyword for the command. Then, execute the undo form of the command after you complete the configuration.
If you modify the routing policy change delay timer before it expires, the timer will be reset.
Examples
# Set the routing policy change delay timer to 60 seconds.
<Sysname> system-view
[Sysname] route-policy-change delay-time 6
IPv4 routing policy commands
apply fast-reroute
Use apply fast-reroute to set a backup link for fast reroute (FRR).
Use undo apply fast-reroute to restore the default.
Syntax
apply fast-reroute { backup-interface interface-type interface-number [ backup-nexthop ip-address ] | backup-nexthop ip-address }
undo apply fast-reroute
Default
No backup link for FRR is configured.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
backup-interface interface-type interface-number: Specifies a backup output interface by its type and number. If the specified interface is a non-P2P interface, you must also specify a backup next hop. Non-P2P interfaces include NBMA and broadcast interfaces.
backup-nexthop ip-address: Specifies a backup next hop.
Examples
# Configure node 10 of routing policy policy1 to set the backup output interface VLAN-interface 1 and backup next hop 193.1.1.8 for the route destined for 100.1.1.0/24.
<Sysname> system-view
[Sysname] ip prefix-list abc index 10 permit 100.1.1.0 24
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match ip address prefix-list abc
[Sysname-route-policy-policy1-10] apply fast-reroute backup-interface vlan-interface 1 backup-nexthop 193.1.1.8
apply ip-address next-hop
Use apply ip-address next-hop to set a next hop for IPv4 routes.
Use undo apply ip-address next-hop to restore the default.
Syntax
apply ip-address next-hop ip-address [ public | vpn-instance vpn-instance-name ]
undo apply ip-address next-hop
Default
No next hop is set for IPv4 routes.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
ip-address: Specifies the next hop IP address.
public: Specifies the public network.
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters.
Usage guidelines
If you use this command to set a next hop for redistributed routes, the configuration does not take effect.
If you do not specify the public keyword and the vpn-instance vpn-instance-name option, the next hop belongs to the public network.
Examples
# Configure node 10 in permit mode for routing policy policy1 to set next hop 193.1.1.8 for routes matching prefix list 100.
<Sysname> system-view
[Sysname] ip prefix-list 100 permit 192.168.10.1 24
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match ip address prefix-list 100
[Sysname-route-policy-policy1-10] apply ip-address next-hop 193.1.1.8
display ip prefix-list
Use display ip prefix-list to display IPv4 prefix list statistics.
Syntax
display ip prefix-list [ name prefix-list-name ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
name prefix-list-name: Specifies an IP prefix list by its name, a case-sensitive string of 1 to 63 characters. If you do not specify this option, the command displays statistics for all IPv4 prefix lists.
Examples
# Display the statistics for IPv4 prefix list abc.
<Sysname> display ip prefix-list name abc
Prefix-list: abc
Permitted 0
Denied 0
index: 10 Deny 6.6.6.0/24 ge 26 le 28
Table 3 Command output
Field |
Description |
Prefix-list |
Name of the IPv4 prefix list. |
Permitted |
Number of routes matching the criterion. |
Denied |
Number of routes not matching the criterion. |
index |
Index of an item. |
deny |
Match mode of the item: · Permit. · Deny. |
6.6.6.0/24 |
IP address and mask. |
ge |
Greater-equal, the lower mask length limit. |
le |
Less-equal, the upper mask length limit. |
Related commands
ip prefix-list
reset ip prefix-list
if-match ip
Use if-match ip to match IPv4 routes whose destination, next hop, or source address matches an ACL or IPv4 prefix list.
Use undo if-match ip to remove the specified ACL or IPv4 prefix list match criterion.
Syntax
if-match ip { address | next-hop } { acl ipv4-acl-number | prefix-list prefix-list-name }
undo if-match ip { address | next-hop } [ acl | prefix-list ]
Default
No ACL or IPv4 prefix list match criterion is configured.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
address: Matches the destination address of IPv4 routes.
next-hop: Matches the next hop of IPv4 routes.
acl ipv4-acl-number: Specifies an ACL by its number. The value range for the ipv4-acl-number argument is 2000 to 3999 for the address keyword, and 2000 to 2999 for the next-hop keyword.
prefix-list prefix-list-name: Specifies an IP prefix list by its name, a case-sensitive string of 1 to 63 characters.
Usage guidelines
When you specify an IPv4 ACL, follow these guidelines:
· If the specified ACL does not exist or does not have any rules, all IPv4 routes can match the ACL.
· If a rule in the specified ACL is applied to a VPN instance, the rule does not take effect.
Examples
# Configure node 10 of routing policy policy1 to match IPv4 routes whose next hop matches IP prefix list p1.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match ip next-hop prefix-list p1
ip prefix-list
Use ip prefix-list to configure an IPv4 prefix list or an item for the list.
Use undo ip prefix-list to remove an IPv4 prefix list or an item of it.
Syntax
ip prefix-list prefix-list-name [ index index-number ] { deny | permit } ip-address mask-length [ greater-equal min-mask-length ] [ less-equal max-mask-length ]
undo ip prefix-list prefix-list-name [ index index-number ]
Default
No IPv4 prefix lists exist.
Views
System view
Predefined user roles
network-admin
Parameters
prefix-list-name: Specifies an IPv4 prefix list name, a case-sensitive string of 1 to 63 characters.
index index-number: Specifies an index number for an IPv4 prefix list item, in the range of 1 to 65535. An item with a smaller index number is matched first. If you do not specify this option, the index number starts from 10 and increases by 10 for each of the consecutive prefix list items.
deny: Specifies the deny mode. If a route matches the item, the route is denied without being compared with the next item. If a route does not match the item, the route is compared with the next item.
permit: Specifies the permit mode. If a route matches the item, it passes the IPv4 prefix list. If a route does not match the item, the route is compared with the next item.
ip-address mask-length: Specifies an IPv4 prefix and mask length. The value range for the mask-length argument is 0 to 32.
greater-equal min-mask-length, less-equal max-mask-length: Specifies a prefix length range. The greater-equal keyword means "greater than or equal to" and the less-equal keyword means "less than or equal to." The prefix length range relation is mask-length <= min-mask-length <= max-mask-length <= 32.
· If only the min-mask-length argument is specified, the prefix length range is [ min-mask-length, 32 ].
· If only the max-mask-length argument is specified, the prefix length range is [ mask-length, max-mask-length ].
· If both the min-mask-length and max-mask-length arguments are specified, the prefix length range is [ min-mask-length, max-mask-length ].
Usage guidelines
An IPv4 prefix list is used to filter IPv4 addresses. It can contain multiple items, each of which specifies a range of IPv4 prefixes. The relation between the items is logical OR. If an item is passed, the IPv4 prefix list is passed. If no item is passed, the IP prefix list cannot be passed.
If both the ip-address and mask-length arguments are specified as 0.0.0.0 0, only the default route will be matched.
To match all routes, use 0.0.0.0 0 less-equal 32.
Examples
# Configure IP prefix list p1 to permit routes destined for network 10.0.0.0/8 and with mask length 17 or 18.
<Sysname> system-view
[Sysname] ip prefix-list p1 permit 10.0.0.0 8 greater-equal 17 less-equal 18
Related commands
display ip prefix-list
reset ip prefix-list
reset ip prefix-list
Use reset ip prefix-list to clear IPv4 prefix list statistics.
Syntax
reset ip prefix-list [ prefix-list-name ]
Views
User view
Predefined user roles
network-admin
Parameters
prefix-list-name: Specifies an IP prefix list by its name, a case-sensitive string of 1 to 63 characters. If you do not specify this argument, the command clears statistics for all IPv4 prefix lists.
Examples
# Clear the statistics for IPv4 prefix list abc.
<Sysname> reset ip prefix-list abc
Related commands
display ip prefix-list
ip prefix-list
IPv6 routing policy commands
apply ipv6 fast-reroute
Use apply ipv6 fast-reroute to set a backup link for fast reroute (FRR).
Use undo apply ipv6 fast-reroute to restore the default.
Syntax
apply ipv6 fast-reroute { backup-interface interface-type interface-number [ backup-nexthop ipv6-address ] | backup-nexthop ipv6-address }
undo apply ipv6 fast-reroute
Default
No backup link for FRR is configured.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
backup-interface interface-type interface-number: Specifies a backup output interface by its type and number. If the specified interface is a non-P2P interface, you must also specify a backup next hop. Non-P2P interfaces include NBMA and broadcast interfaces.
backup-nexthop ipv6-address: Specifies an IPv6 backup next hop.
Examples
# Configure node 10 of routing policy policy1 to set the backup next hop 1::1/64 for the route destined for 100::1/64.
<Sysname> system-view
[Sysname] ipv6 prefix-list abc index 10 permit 100::1 64
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match ipv6 address prefix-list abc
[Sysname-route-policy-policy1-10] apply ipv6 fast-reroute backup-nexthop 1::1
apply ipv6 next-hop
Use apply ipv6 next-hop to set a next hop for IPv6 routes.
Use undo apply ipv6 next-hop to restore the default.
Syntax
apply ipv6 next-hop ipv6-address
undo apply ipv6 next-hop
Default
No next hop is set for IPv6 routes.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
ipv6-address: Specifies the next hop IPv6 address.
Usage guidelines
If you use this command to set a next hop for redistributed routes, the configuration does not take effect.
Examples
# Configure node 10 in permit mode for routing policy policy1 to set next hop 3ffe:506::1 for IPv6 routes matching prefix list 100.
<Sysname> system-view
[Sysname] ipv6 prefix-list 100 permit 2::2 64
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match ipv6 address prefix-list 100
[Sysname-route-policy-policy1-10] apply ipv6 next-hop 3ffe:506::1
display ipv6 prefix-list
Use display ipv6 prefix-list to display IPv6 prefix list statistics.
Syntax
display ipv6 prefix-list [ name prefix-list-name ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
name prefix-list-name: Specifies an IPv6 prefix list by its name, a case-sensitive string of 1 to 63 characters. If you do not specify this option, the command displays statistics for all IPv6 prefix lists.
Examples
# Display the statistics for all IPv6 prefix lists.
<Sysname> display ipv6 prefix-list
Prefix-list6: 666
Permitted 0
Denied 0
index: 10 Permit 6::/64 ge 66 le 88
Table 4 Command output
Field |
Description |
Prefix-list6 |
Name of the IPv6 prefix list. |
Permitted |
Number of routes matching the criterion. |
Denied |
Number of routes not matching the criterion. |
index |
Index number of an item. |
permit |
Match mode of the item: · Permit. · Deny. |
6::/64 |
IPv6 address and prefix length for matching. |
ge |
Greater-equal, the lower prefix length limit. |
le |
Less-equal, the upper prefix length limit. |
Related commands
ipv6 prefix-list
reset ipv6 prefix-list
if-match ipv6
Use if-match ipv6 to match IPv6 routes whose destination, next hop, or source address matches an ACL or IPv6 prefix list.
Use undo if-match ipv6 to remove the specified ACL or IPv6 prefix list match criterion.
Syntax
if-match ipv6 { address | next-hop | route-source } { acl ipv6-acl-number | prefix-list prefix-list-name
undo if-match ipv6 { address | next-hop | route-source } [ acl | prefix-list ]
Default
No ACL or IPv6 prefix list match criterion is configured.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
address: Matches the destination address of IPv6 routes.
next-hop: Matches the next hop of IPv6 routes.
route-source: Matches the source address of IPv6 routes.
acl ipv6-acl-number: Specifies an IPv6 ACL by its number. The value range for the ipv6-acl-number argument is 2000 to 3999 for the address keyword, and 2000 to 2999 for the next-hop and route-source keywords.
prefix-list prefix-list-name: Specifies an IPv6 prefix list by its name, a case-sensitive string of 1 to 63 characters.
Usage guidelines
When you specify an IPv6 ACL, follow these guidelines:
· If the specified ACL does not exist or does not have any rules, all IPv6 routes can match the ACL.
· If a rule in the specified ACL is applied to a VPN instance, the rule does not take effect.
Examples
# Configure node 10 of routing policy policy1 to permit routes whose next hop matches IPv6 prefix list p1.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy-policy1-10] if-match ipv6 next-hop prefix-list p1
if-match ipv6 even-prefix-length
Use if-match ipv6 even-prefix-length to match IPv6 route prefixes of the specified length whose last bit is an even number.
Use undo if-match ipv6 even-prefix-length to restore the default.
Syntax
if-match ipv6 even-prefix-length prefix-length-number
undo if-match ipv6 even-prefix-length
Default
No match criterion is configured to match the length and last bit of IPv6 route prefixes.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
prefix-length-number: Specifies a prefix length in the range of 1 to 128.
Examples
# Configure node 10 of routing policy rp1 to permit a route if its prefix length is 64 and the last bit of its prefix is an even number.
<Sysname> system-view
[Sysname] route-policy rp1 permit node 10
[Sysname-route-policy-rp1-10] if-match ipv6 even-prefix-length 64
if-match ipv6 odd-prefix-length
Use if-match ipv6 odd-prefix-length to match IPv6 route prefixes of the specified length whose last bit is an odd number.
Use undo if-match ipv6 odd-prefix-length to restore the default.
Syntax
if-match ipv6 odd-prefix-length prefix-length-number
undo if-match ipv6 odd-prefix-length
Default
No match criterion is configured to match the length and last bit of IPv6 route prefixes.
Views
Routing policy node view
Predefined user roles
network-admin
Parameters
prefix-length-number: Specifies a prefix length in the range of 1 to 128.
Examples
# Configure node 10 of routing policy rp1 to permit a route if its prefix length is 64 and the last bit of its prefix is an odd number.
<Sysname> system-view
[Sysname] route-policy rp1 permit node 10
[Sysname-route-policy-rp1-10] if-match ipv6 odd-prefix-length 64
ipv6 prefix-list
Use ipv6 prefix-list to configure an IPv6 prefix list or an item for it.
Use undo ipv6 prefix-list to remove an IPv6 prefix list or an item.
Syntax
ipv6 prefix-list prefix-list-name [ index index-number ] { deny | permit } ipv6-address { prefix-length [ greater-equal min-prefix-length ] [ less-equal max-prefix-length ] | inverse inverse-prefix-length }
undo ipv6 prefix-list prefix-list-name [ index index-number ]
Default
No IPv6 prefix lists exist.
Views
System view
Predefined user roles
network-admin
Parameters
prefix-list-name: Specifies an IPv6 prefix list name, a case-sensitive string of 1 to 63 characters.
index index-number: Specifies an index number for an IPv6 prefix list item, in the range of 1 to 65535. An item with a smaller index number is matched first. If you do not specify this option, the index number starts from 10 and increases by 10 for each of the consecutive IPv6 prefix list items.
deny: Specifies the deny mode. If a route matches the item, the route is denied without being compared with the next item. If a route does not match the item, the route is compared with the next item.
permit: Specifies the permit mode. If a route matches the item, it passes the IPv6 prefix list. If a route does not match the item, the route is compared with the next item.
ipv6-address: Specifies an IPv6 address.
prefix-length: Specifies the IPv6 prefix length. The value range for the prefix-length argument is 0 to 128.
greater-equal min-mask-length, less-equal max-mask-length: Specifies a prefix length range. The greater-equal keyword means "greater than or equal to" and the less-equal keyword means "less than or equal to."
The prefix length range relation is mask-length <= min-mask-length <= max-mask-length <= 128.
· If only the min-prefix-length argument is specified, the prefix length range is [ min-prefix-length, 128 ].
· If only the max-prefix-length argument is specified, the prefix length range is [ prefix-length, max-prefix-length ].
· If both the min-prefix-length and max-prefix-length arguments are specified, the prefix length range is [ min-prefix-length, max-prefix-length ].
inverse inverse-prefix-length: Matches IPv6 addresses from the least significant bit to the specified length. The value range for the inverse-prefix-length argument is 1 to 128.
Usage guidelines
An IPv6 prefix list is used to filter IPv6 addresses. An IPv6 prefix list can have multiple items, and each of them specifies a range of IPv6 prefixes. The relation between the items is logical OR. A route passing an item passes the IPv6 prefix list. A route passing no item does not pass the IPv6 prefix list.
If the ipv6-address prefix-length argument is specified as :: 0, only the default route matches.
To match all routes, configure :: 0 less-equal 128.
Examples
# Permit IPv6 addresses with a mask length between 32 bits and 64 bits.
<Sysname> system-view
[Sysname] ipv6 prefix-list abc permit :: 0 greater-equal 32 less-equal 64
# Deny IPv6 addresses with a prefix 3FFE:D00::/32 and a prefix length greater than or equal to 32 bits.
<Sysname> system-view
[Sysname] ipv6 prefix-list abc deny 3FFE:D00:: 32 less-equal 128
Related commands
display ipv6 prefix-list
reset ipv6 prefix-list
reset ipv6 prefix-list
Use reset ipv6 prefix-list to clear IPv6 prefix list statistics.
Syntax
reset ipv6 prefix-list [ prefix-list-name ]
Views
User view
Predefined user roles
network-admin
Parameters
prefix-list-name: Specifies an IPv6 prefix list by its name, a case-sensitive string of 1 to 63 characters. If you do not specify this argument, the command clears statistics for all IPv6 prefix lists.
Examples
# Clear the statistics for IPv6 prefix list abc.
<Sysname> reset ipv6 prefix-list abc
Related commands
display ipv6 prefix-list
ipv6 prefix-list