< Home

Configuring the BGP Preference

Setting the BGP preference can affect route selection between BGP routes and other routing protocols' routes.

Context

Multiple dynamic routing protocols can be run on a device at the same time. In this case, there is a problem of route sharing and selecting among routing protocols. To address this problem, the system sets a default preference for each routing protocol. If different protocols have routes to the same destination, the protocol with the highest preference is selected to forward IP packets.

Procedure

  1. Access the system view.

    system-view

  2. Access the BGP view.

    bgp { as-number-plain | as-number-dot }

  3. Access the BGP-IPv4 unicast address family view.

    ipv4-family unicast

  4. Set the BGP preference.

    preference { external internal local | route-policy route-policy-name }

    BGP has the following types of routes:

    • Routes learned from EBGP peers
    • Routes learned from IBGP peers
    • Routes that originated locally (Local Originated)

      The local route refers to the route aggregated through aggregation commands, that is, summary automatic (automatic aggregation) and aggregate (manual aggregation).

    You can set different preferences for these three types of routes.

    You can also use the routing policy to set the preferences for the specified routes that meet the requirements. You can set the default preferences for the routes that do not meet the requirements.

    You cannot use the peer route-policy command to apply routing policies to set the preference for BGP.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >