< Home

default local-preference

Function

The default local-preference command sets the default local preference for BGP routes.

The undo default local-preference command restores the default configuration.

By default, the local preference for BGP routes is 100.

Format

default local-preference local-preference

undo default local-preference

Parameters

Parameter Description Value
local-preference Specifies the local preference for BGP routes. The greater the value, the higher the preference. The value is an integer that ranges from 0 to 4294967295.

Views

BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view, BGP-VPNv6 address family view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The Local_Pref attribute is used to determine an optimal route for traffic before traffic leaves an AS. When the switch that runs BGP has multiple routes to the same destination, the switch selects the route with the highest local preference as the optimal route.

Precautions

If the switch is already configured with a default local preference for BGP routes, the configuration of a new default local preference will override the previous configuration.

The local preference is exchanged only between IBGP peers and is not advertised to other ASs.

Example

# Set the default local preference for BGP routes to 200.

<HUAWEI> system-view
[HUAWEI] bgp 100
[HUAWEI-bgp] ipv4-family unicast 
[HUAWEI-bgp-af-ipv4] default local-preference 200
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >