S300, S500, S2700, S5700, and S6700 V200R022C10 Command Reference

apply local-preference

apply local-preference

Function

The apply local-preference command sets the action for changing the local preference of BGP routes in a routing policy.

The undo apply local-preference command restores the default setting.

By default, the action for changing the local preference of BGP routes is not set in a routing policy.

Product

Support

S5720I-SI, S5735-S, S500, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6720S-S, S6730-H, S6730S-H, S6730-S, and S6730S-S

Supported.

S5720-LI, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, and S5720S-LI

Not supported.

Format

apply local-preference preference

undo apply local-preference

Parameters

Parameter Description Value

preference

Specifies the local preference of BGP routes.

The value is an integer ranging from 0 to 4294967295.

Views

Route-Policy view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The Local-Pref attribute is a private attribute of BGP. The apply local-preference command sets only the local preference for BGP routes. The Local_Pref attribute is used to determine the optimal route when traffic leaves an AS, and its default value is 100. When a BGP router obtains multiple routes to the same destination address but with different next hops through IBGP peers, the route with the largest Local_Pref value is selected.

Prerequisites

After a BGP route matches a routing policy, you can change the local preference of the BGP route.

Precautions

  • When a routing policy takes effect, it affects BGP route selection.
  • The Local_Pref attribute applies to the routing within an AS rather than be advertised to the outside of the AS. In this case, the apply local-preference command does not take effect when EBGP neighbor relationships are set up.
  • After the apply local-preference command is run in a route-policy or its configuration is changed, route updates are triggered.

Example

# Set the local preference of BGP routes to 130.

<HUAWEI> system-view
[HUAWEI] route-policy policy permit node 10
[HUAWEI-route-policy] apply local-preference 130
Translation
Favorite
Download
Update Date:2025-05-27
Document ID:EDOC1100325914
Views:831527
Downloads:918
Average rating:0.0Points

Digital Signature File

digtal sigature tool