The if-match route-type command sets a matching rule that is based on the route type.
The undo if-match route-type command cancels the configuration.
By default, no matching rule based on the route type is set.
if-match route-type { external-type1 | external-type1or2 | external-type2 | internal | is-is-level-1 | is-is-level-2 | nssa-external-type1 | nssa-external-type1or2 | nssa-external-type2 }
undo if-match route-type { external-type1 | external-type1or2 | external-type2 | internal | is-is-level-1 | is-is-level-2 | nssa-external-type1 | nssa-external-type1or2 | nssa-external-type2 }
| Parameter | Description | Value |
|---|---|---|
| external-type1 | Indicates OSPF external Type 1 routes. | - |
| external-type1or2 | Indicates OSPF external routes. | - |
| external-type2 | Indicates OSPF external Type 2 routes. | - |
| internal | Indicates internal routes, including OSPF inter-area routes and intra-area routes. | - |
| is-is-level-1 | Indicates IS-IS Level-1 routes. | - |
| is-is-level-2 | Indicates IS-IS Level-2 routes. | - |
| nssa-external-type1 | Indicates NSSA external Type 1 routes. | - |
| nssa-external-type1or2 | Indicates NSSA external routes. | - |
| nssa-external-type2 | Indicates NSSA external Type 2 routes. | - |
Usage Scenario
You can run the if-match route-type command to filter OSPF or IS-IS routes based on the route type.
Prerequisites
The if-match route-type command can be used only after the route-policy command is used.
Precautions
For the same node in a route-policy, if two if-match route-type clauses are the same, the latter if-match route-type will not override the previous if-match route-type. After the latter clause is configured, both clauses take effect simultaneously. The relationship between if-match route-type clauses is "OR". That is, the actions defined by apply clauses can be performed on a route as long as the route meets one of the matching rules. For example, if both the if-match route-type is-is-level-1 and if-match route-type external-type1or2 commands are configured on the same node of a route policy, both IS-IS Level-1 routes and OSPF external routes can match the route policy.
external-type1or2 refers to external-type1 or external-type2. For the same node in a route policy, configuring both the if-match route-type external-type1 and if-match route-type external-type2 is equivalent to configuring the if-match route-type external-type1or2 command. The two operations generate the same configuration file.
Similarly, nssa-external-type1or2 refers to nssa-external-type1 or nssa-external-type2. For the same node in a route policy, configuring both the if-match route-type nssa-external-type1 and if-match route-type nssa-external-type2 commands is equivalent to configuring theif-match route-type nssa-external-type1or2 command. The two operations generate the same configuration file.