< Home

if-match tag

Function

The if-match tag command sets a matching rule that is based on the route tag.

The undo if-match tag command cancels the configuration.

By default, no matching rule based on the route tag is set.

Format

if-match tag tag

undo if-match tag

Parameters

Parameter Description Value
tag Increases the tag value. The value is an integer ranging from 0 to 4294967295.

Views

Route-policy view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

You can run the if-match tag command to filter OSPF or IS-IS routes based on the tags.

For the same node in a route-policy, the relationship between the if-match clauses is "AND". The route must meet all the matching rules before the actions defined by the apply clauses are performed. If no if-match clause is specified, all the routes are matched.

Prerequisites

The if-match tag command can be used only after the route-policy command is used to enter the route-policy view.

Example

# Define a rule to match routes with the tag value 8.

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