The default local-preference command configures a Local_Pref for BGP routes.
The undo default local-preference command restores the default value.
By default, the Local_Pref of BGP routes is 100.
Usage Scenario
Local_Pref is used to determine the optimal route for the traffic that leaves an AS. If BGP receives from different IBGP peers multiple routes to the same destination address but with different next hops, it selects the route with the largest Local_Pref value.
Configuration Impact
If the default local-preference command is run more than once, the latest configuration overrides the previous one.
Precautions
The Local_Pref is valid among IBGP peers and is not advertised to other ASs.
<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv4-family [*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpna-af-ipv4] quit [*HUAWEI-vpn-instance-vpna] quit [*HUAWEI] bgp 100 [*HUAWEI-bgp] vpn-instance vpna [*HUAWEI-bgp-instance-vpna] quit [*HUAWEI-bgp] ipv4-labeled-unicast vpn-instance vpna [*HUAWEI-bgp-labeled-vpna] default local-preference 200