The apply-label per-instance command sets the label allocation mode to one label per instance. In this mode, all the routes of the VPN instance address family destined for the remote PE are assigned the same label.
The undo apply-label per-instance command restores the default configuration.
By default, the VPN instance address family assigns the same label to all routes to be sent to the peer PE.
VPN instance view, VPN instance IPv4 address family view, VPN instance IPv6 address family view
Usage Scenario
In BGP/MPLS IP VPN networking, if VPN routes on PE are numerous but MPLS label resources are insufficient, the apply-label per-instance command can be run to minimize MPLS label consumption on PE.
When 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.
By default, the system applies for a label for each route in a VPN instance enabled with the IPv4 or IPv6 address family. After the apply-label per-instance command is run in the IPv4 or IPv6 address family view of the VPN instance, the routes of the VPN instance enabled with the corresponding address family will be allocated the same label. For example, a PE is configured with two VPN instances that have 20000 routes in total. By default, 20000 MPLS labels will be allocated to the routes. If the apply-label per-instance command is run, only two MPLS labels will be allocated to the routes.
You can run the display fib statistics command to check the number of VPN routes.
Prerequisites
Precautions
The change of the label allocation mode leads to the re-advertising of VPN routes. The services may be interrupted temporarily. Therefore, use the apply-label per-instance and undo apply-label per-instance commands with caution.
If there are a large number of VPN routes in the system, frequently executing this command will cause flapping of many routes. Route flapping results in a high CPU usage but does not affect real-time services in the system.
# Assign one label to all routes of the IPv4 address family of the VPN instance named vpn1.
<HUAWEI> system-view [HUAWEI] ip vpn-instance vpn1 [HUAWEI-vpn-instance-vpn1] ipv4-family [HUAWEI-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1 [HUAWEI-vpn-instance-vpn1-af-ipv4] apply-label per-instance