< Home

if-match cost

Function

The if-match cost command creates a matching rule based on the route cost.

The undo if-match cost command deletes the matching rule based on the specified route cost.

By default, no matching rule based on the route cost is configured.

Format

if-match cost { cost | greater-equal greater-equal-value [ less-equal less-equal-value ] | less-equal less-equal-value }

undo if-match cost

Parameters

Parameter Description Value
cost Specifies the route cost. Route costs can be changed to prevent routing loops. The value is an integer ranging from 0 to 4294967295.
greater-equal greater-equal-value Specifies the minimum value of route cost. The value is an integer ranging from 0 to 4294967294.
less-equal less-equal-value Specifies the maximum value of route cost. less-equal-value is demanded to be greater than greater-equal-value. The value is an integer ranging from 1 to 4294967295.

Views

Route-Policy view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

You can use the if-match cost command to configure a node to filter routes based on the route costs. After such a matching rule is configured, you can apply the apply clauses to change the attributes of the routes that match the matching rule.

Prerequisites

The if-match cost command can be used only after the route-policy command is used.

Precautions

The routing policy matches routes based on the route cost. Routes that match the route cost will be checked by other if-match clauses of this node. Routes that do not match the route cost will be checked by the next node.

Example

# Match the route with the cost 8.

<HUAWEI> system-view
[HUAWEI] route-policy policy permit node 10
[HUAWEI-route-policy] if-match cost 8
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >