policy-based-route

Function

The policy-based-route command creates or modifies a PBR policy or node and displays the policy-based-route view.

The undo policy-based-route command deletes a PBR policy or node.

By default, no PBR policy or node is created.

Format

policy-based-route policy-name permit node node-id [ map-instance map-instance-id ]

undo policy-based-route policy-name permit node node-id [ map-instance map-instance-id ]

undo policy-based-route policy-name permit

Parameters

Parameter Description Value
policy-name

Specifies the name of a PBR policy.

The value is a string of 1 to 31 characters.

A maximum of 100 policy-name can be configured.

permit

Indicates the mode of a PBR node. This mode applies PBR to matching packets.

-

node node-id

Specifies the ID of a PBR node. A smaller node-id indicates a higher PBR priority. The PBR policy with a higher priority is implemented preferentially.

The value is an integer ranging from 1 to 65534.

A maximum of 200 PBR nodes can be configured.

map-instance map-instance-id

Specifies the MIB object ID.

The value is an integer ranging from 1 to 65534.

The map-instance-id value must be the same as the node-id value, and they are the same by default.

Views

System view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
cli execute

Usage Guidelines

Usage Scenario

PBR is deployed in the scenario where users want specific traffic to be forwarded to a desired next hop. Each node in each traffic policy for PBR is configured with rules and an action. The action is redirecting matching IP packets to an outbound interface.

If the PBR policy or node specified in the policy-based-route command does not exist, the policy-based-route command creates it. If the PBR policy and node specified in the policy-based-route command exist, the policy-based-route command modifies them.

Example

# Create a PBR policy named pbr1 and node 1 and set the mode of node 1 to permit.
<HUAWEI> system-view
[~HUAWEI] policy-based-route pbr1 permit node 1 map-instance 1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic