apply-label

Function

The apply-label command configures a label allocation mode in a VPN instance IPv4 address family.

The undo apply-label command restores the default label allocation mode in a VPN instance IPv4 address family.

The command varies in transport and router modes. For detailed differences, see "Differences Between Commands in Transport and Router Modes." The command implementation in router mode is described here.

By default, the VPN instance IPv4 address family assigns the same label to all routes in the VPN instance.

Format

apply-label { per-instance | per-nexthop | per-route }

undo apply-label { per-instance | per-nexthop | per-route }

Parameters

Parameter Description Value
per-instance

Enables the one-label-per-VPN-instance mode.

-

per-nexthop

Enables the one-label-per-next-hop mode.

-

per-route

Enables the one-label-per-route mode.

-

Views

VPN instance view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
l3vpn write

Usage Guidelines

Usage Scenario

By default, all routes of a VPN instance IPv4 address family is assigned a specified label. If a large number of routes of the VPN instance IPv4 address family need to apply for labels, the apply-label per-instance command saves label resources of PEs and lowers the requirements for PE capacities.

In private network packet forwarding, labels are allocated based on routes and next hops. Packets are forwarded based on the next hop information of the labels, and do not need to be forwarded again. The forwarding speed is fast. However, one-label-per-instance label allocation requires devices to additionally search the routing table, lowering the forwarding speed. If label resources are sufficient and a rapid forwarding speed is required, you can configure the one-label-per-route or one-label-per-next-hop mode.

Prerequisites

An RD has been configured for the VPN instance using the route-distinguisher command.

Precautions

Changing the label allocation mode causes route re-advertisement, which interrupts services temporarily. Therefore, exercise caution when running this command. If the apply label command and the apply-label per-nexthop pop-go command are both run, the latest configuration overrides the previous one.

This command applies only to the scenario where MPLS labels are allocated to VPN instances.

Example

# Configure a PE to assign only one label to VPNv4 routes that share the same next hop and outgoing label in a VPN instance named vpn1.
<HUAWEI> system-view
[~HUAWEI] ip vpn-instance vpn1
[*HUAWEI-vpn-instance-vpn1] route-distinguisher 100:1
[*HUAWEI-vpn-instance-vpn1] apply-label per-nexthop
# Configure a PE to assign a label to each route in a VPN instance named vpn1.
<HUAWEI> system-view
[~HUAWEI] ip vpn-instance vpn1
[*HUAWEI-vpn-instance-vpn1] route-distinguisher 100:1
[*HUAWEI-vpn-instance-vpn1] apply-label per-route
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >