else

Function

The else command matches the routes that fail to meet all the previous matching rules in one if condition branch.

By default, the else command is not run.

Format

else

Parameters

None

Views

Route-filter policy view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
route-base write

Usage Guidelines

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 match the routes that fail to meet all the previous matching rules in one if condition branch, run the else command.

Prerequisites

A matching rule has been configured for the route-filter using the if or elseif command.

Follow-up Procedure

Run the apply, approve, refuse, finish, call route-filter, or break command to configure an action clause for the routes that fail to meet all the previous matching rules in one if condition branch.

Example

# Configure a route-filter to set the next hop IP address of the routes with MED 100, the routes with MED 200, and the rest routes to 1.1.1.1, 2.2.2.2, and 3.3.3.3, respectively.
<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] else
[~HUAWEI-xpl-filter-else] apply ip next-hop 3.3.3.3
[~HUAWEI-xpl-filter-else] endif
[~HUAWEI-xpl-filter] end-filter
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >