The apply-label per-nexthop command enables the ASBR to allocate labels for IPv4 VPN routes or IPv6 VPN routes based on the next hop.
The undo apply-label per-nexthop command disables the ASBR from allocating labels for IPv4 VPN routes or IPv6 VPN routes based on the next hop.
By default, next-hop-based label allocation for VPN routes is disabled on the ASBR, and a label is allocated to each VPN instance.
Usage Scenario
In inter-AS VPN Option B or HoVPN networking, if MPLS label resources on the ASBR or SPE are insufficient for the advertised VPNv4 or VPNv6 routes to use, the apply-label per-nexthop command can be run to minimize MPLS label consumption on the ASBR or SPE.
By default, the ASBR or SPE allocates a label to each VPNv4 or VPNv6 route when advertising it to an MP-BGP peer. If the apply-label per-nexthop command is run, the ASBR or SPE will allocate one label to all the routes with the same next hop and outgoing label. To make the routes learned from the same next hop have the same outgoing label, run the apply-label per-instance command on the PE. Otherwise, the effect of the apply-label per-nexthop command will be affected.
Configuration Impact
After next-hop-based label allocation is enabled or disabled, the label allocated by the ASBR to a route changes, which leads to a transient loss of VPN packets.