route-policy
Function
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.
Format
route-policy route-policy-name { permit | deny } node node
undo route-policy route-policy-name [ node node ]
Parameters
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 must be unique and is a string of 1 to 40 characters. It is case-sensitive. |
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 Guidelines
Usage Scenario
A route-policy is used to filter routes and set route attributes for the routes that match the route-policy. A route-policy consists of multiple nodes. One node can be configured with multiple if-match and apply clauses. The if-match clauses define filtering rules for this node, and the apply clauses define behaviors for the routes that match the rules.
The relationship among if-match clauses of the same node that are based on different route attributes is AND. A route matches a node only when the route matches all the filtering rules specified in the if-match clauses of the node. The apply clauses specify actions. The relationship among if-match clauses of the same node that are based on the same route attribute is OR. The system matches routes against the if-match clauses in order. If a route matches an if-match clause, the system no longer matches the route against the rest if-match clauses. For example, the if-match community-filter 1 and if-match as-path-filter 1 configurations in node 10 are based on different route attributes. Therefore, the relationship among if-match clauses of this node is AND. The if-match community-filter 1 and if-match community-filter 2 configurations in node 20 are both based on the community attribute. Therefore, the relationship among if-match clauses of this node is OR. If no if-match clause is specified, all the routes can pass the node.
The relationship between the nodes of a route-policy is "OR". That is, if a route matches one node, the route matches the route-policy. If the route does not match any node, the route fails to match the route-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.
Example
# Configure the routing policy named policy1 whose node number is 10 and the matching mode is permit.
<AC6605> system-view
[AC6605] ip ip-prefix prefix-a index 10 permit 172.17.1.0 24
[AC6605] route-policy policy1 permit node 10
[AC6605-route-policy] if-match ip-prefix prefix-a
[AC6605-route-policy] apply cost 100