The elseif command configures another matching rule to filter the routes that fail to meet the matching rules specified in the if or elseif clause of the same if condition branch.
By default, the routes that fail to meet the matching rules specified in the if or elseif clause are not further matched against other matching rules.
Parameter | Description | Value |
---|---|---|
not |
Filters routes against the opposite of the matching rule following not. |
- |
condition-clause |
Specifies a condition clause. |
For details of condition clauses, see the following descriptions:
|
and |
Filters routes against the matching rule of the previous condition clause and the one following and. |
- |
or |
Filters routes against the matching rule of the previous condition clause or the one following or. |
- |
then |
Introduces the action clause configured for the routes that meet matching rules. |
- |
Usage Scenario
Route-filters are used to filter routes based on sets or a single element and modify route attributes of the routes that meet matching rules. To configure another matching rule to filter the routes that fail to meet the matching rules specified in the if or elseif clause of the same if condition branch, run the elseif command.
The parameters in condition clauses can be specific values or global variables referenced using $+global variable name. The parameters in a route-filter with pre-defined variables can be those defined in this route-filter. Global variables cannot be referenced by the route attribute sets in the format of {element A, element B...}.Prerequisites
A matching rule has been configured for the route-filter using the if command.
Follow-up Procedure
Run the apply, approve, refuse, finish, call route-filter, or break command to configure an action for the routes that meet matching rules.
Precautions
The maximum number of nested if clauses is 64. One if clause can connect 32 AND or OR Boolean operators. The keyword NOT can be consecutively nested for a maximum of 4 times.
If ip { route-source | route-destination | next-hop } in { ip-prefix-list-name | ip-prefix-list } is configured, the configuration applies to IPv4 prefixes, not to IPv6 prefixes, and IPv6 prefixes match the configuration by default. If IPv6 prefixes also need to be filtered, perform the following configurations: xpl ipv6-prefix-list ipv6-list-null end-list if ip { route-source | route-destination | next-hop } in { ip-prefix-list-name | ip-prefix-list } then if ipv6 { route-source | route-destination | next-hop } in ipv6-list-null then finish elseif ip { route-source | route-destination | next-hop } in { ip-prefix-list-name | ip-prefix-list } then apply action-clause endif endif If ipv6 { route-source | route-destination } in { ipv6-prefix-list-name | ipv6-prefix-list } is configured, the configuration applies to IPv6 prefixes, not to IPv4 prefixes, and IPv4 prefixes match the configuration by default. If IPv4 prefixes also need to be filtered, perform the following configurations: xpl ip-prefix-list ipv4-list-null end-list if ipv6 { route-source | route-destination | next-hop } in { ip-prefix-list-name | ip-prefix-list } then if ip { route-source | route-destination | next-hop } in ipv4-list-null then finish elseif ip { route-source | route-destination | next-hop } in { ip-prefix-list-name | ip-prefix-list } then apply action-clause endif endif<HUAWEI> system [~HUAWEI] xpl route-filter route-filter1 [~HUAWEI-xpl-filter] if med eq 100 then [~HUAWEI-xpl-filter-if] apply ip next-hop 1.1.1.1 [~HUAWEI-xpl-filter-if] elseif med eq 200 then [~HUAWEI-xpl-filter-elif] apply ip next-hop 2.2.2.2 [~HUAWEI-xpl-filter-elif] endif [~HUAWEI-xpl-filter] end-filter