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.
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.<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpn1 [*HUAWEI-vpn-instance-vpn1] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpn1] apply-label per-nexthop
<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpn1 [*HUAWEI-vpn-instance-vpn1] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpn1] apply-label per-route