The route-policy command creates a routing policy and displays the Route-Policy view.
The undo route-policy command deletes a specified routing policy.
By default, no routing policy is configured.
route-policy route-policy-name { permit | deny } node node
undo route-policy route-policy-name [ node node ]
Parameter | Description | Value |
---|---|---|
route-policy-name | Specifies the name of a routing policy. If the routing policy does no exist, create a routing policy and enter its Route-Policy view. If the routing policy exists, enter its Route-Policy view. | The name is a string of 1 to 40 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
permit | Specifies the matching mode of the routing policy as permit. In permit mode, a route matches all the if-match clauses, the route matches the routing policy and the actions defined by the apply clause are performed on the route. Otherwise, the route continues to match the next entry. | - |
deny | Specifies the matching mode of the routing policy as deny. In deny mode, if a route matches all the if-match clauses, the route fails to match the routing policy and cannot match the next node. | - |
node node | Specifies the index of the node in the routing policy. When the routing policy is used to filter routes, the node with the smaller value of node is matched first. | The value is an integer ranging from 0 to 65535. |
Usage Scenario
A routing policy is used to filter routes and set route attributes for the routes that match the routing policy. A routing policy consists of multiple nodes. One node can be configured with multiple if-match and apply clauses.
The if-match clauses define matching rules for this node, and the apply clauses define behaviors for the routes that match the rules. The relationship between if-match clauses is "AND". That is, a route must match all the if-match clauses. The relationship between the nodes of a routing policy is "OR". That is, if a route matches one node, the route matches the routing policy. If the route does not match any node, the route fails to match the routing policy.
Procedure
After a routing policy is created, the system prompts "Info: New Sequence of this List !" and displays the Route-Policy view. The system displays no prompt when a routing policy is deleted.
Precautions
After a route-policy is configured, by default, the RM immediately notifies each protocol to apply the route-policy to filter routes. To delay applying a route-policy, you need to run the route-policy-change notify-delay command to set the delay for applying the route-policy.
You can run the display route-policy command to view the number of routes that match and do not match the route-policy.
An route-policy-name must have been configured using the route-policy command before the route-policy-name is referenced by another command.
Before you run the undo route-policy command to delete a route-policy that is referenced by another command, delete the reference configuration.
If an if-match clause of a route-policy defines an ip-prefix-based filtering rule, the filtering rule applies to IPv4 prefixes, not to IPv6 prefixes, and IPv6 prefixes match the filtering rule by default. If IPv6 prefixes also need to be filtered, add an ipv6-prefix-based if-match clause. Similarly, if an if-match clause of a route-policy defines an ipv6-prefix-based filtering rule, the filtering rule applies to IPv6 prefixes, not to IPv4 prefixes, and IPv4 prefixes match the filtering rule by default. If IPv4 prefixes also need to be filtered, add an ip-prefix-based if-match clause.
The configuration of a peer takes precedence over that of the peer group to which the peer belongs. That is, when a routing policy is used to control BGP route advertisement or receiving, the priority of this configuration on a BGP peer is higher than that of the configuration on the peer group.