The route-policy command creates a route-policy and displays the Route-policy view.
The undo route-policy command deletes the created route-policy.
By default, no route-policy is created.
Parameter | Description | Value |
---|---|---|
route-policy-name |
Specifies the name of the route-policy. |
The name is a string of 1 to 200 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
matchMode |
Specifies the matching mode of the route-policy. |
The value is an enumerated type:
|
node node |
Specifies the index of the node in the route-policy. |
The value is an integer ranging from 0 to 65535. When the route-policy is used to filter routes, the node with the smaller value is matched against first. |
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.Precautions
<HUAWEI> system-view [~HUAWEI] ip ip-prefix prefix-a index 10 permit 172.17.1.0 24 [*HUAWEI] route-policy policy1 permit node 10 [*HUAWEI-route-policy] if-match ip-prefix prefix-a [*HUAWEI-route-policy] apply cost 100