Setting the BGP Priority

Setting the BGP priority can control route selection between BGP routes and routes of another routing protocol.

Context

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

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run bgp as-number

    The BGP view is displayed.

  3. Run ipv4-family unicast

    The IPv4 unicast address family view is displayed.

  4. Run preference { external internal local | route-policy route-policy-name | route-filter route-filter-name }

    The BGP preference is set.

    The smaller the value, the higher the priority.

    BGP has the following types of routes:

    • Routes learned from external peers (EBGP)

    • Routes learned from internal peers (IBGP)

    • Routes generated locally using the summary automatic or aggregate command.

    You can set different priorities for the three types of routes.

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

    Currently, you cannot run the peer route-policy or peer route-filter command to apply routing policies to set the priority for BGP.

  5. Run commit

    The configuration is committed.

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