215
Among multiple routes that have the same destination/mask and are learned from different peers,
the one with the greatest preferred value is selected as the optimal route.
To specify a preferred value for routes from a peer or peer group (IPv4):
Step Command Remarks
1. Enter system view.
system-view
N/A
2. Enter BGP view or BGP-VPN
instance view.
• Enter BGP view:
bgp as-number
• Enter BGP-VPN instance
view:
a. bgp as-number
b. ip vpn-instance
vpn-instance-name
N/A
3. Enter BGP IPv4 unicast
address family view or
BGP-VPN IPv4 unicast
address family view.
address-family ipv4
[
unicast
]
N/A
4. Specify a preferred value for
routes received from a peer
or peer group.
peer
{ group-name | ip-address
[ mask-length ] }
preferred-value
value
The default preferred value is 0.
To specify a preferred value for routes from a peer or peer group (IPv6):
Step Command Remarks
1. Enter system view.
system-view
N/A
2. Enter BGP view or BGP-VPN
instance view.
• Enter BGP view:
bgp as-number
• Enter BGP-VPN instance
view:
a. bgp as-number
b. ip vpn-instance
vpn-instance-name
N/A
3. Enter BGP IPv6 unicast
address family view or
BGP-VPN IPv6 unicast
address family view.
address-family ipv6
[
unicast
]
N/A
4. Specify a preferred value for
routes received from a peer
or peer group.
peer
{ group-name | ipv6-address
[ prefix-length ] }
preferred-value
value
The default preferred value is 0.
Configuring preferences for BGP routes
Routing protocols each have a default preference. If they find multiple routes destined for the same
network, the route found by the routing protocol with the highest preference is selected as the
optimal route.
You can use the preference command to modify preferences for EBGP, IBGP, and local BGP routes,
or reference a routing policy to set a preference for matching routes. For routes not matching the
routing policy, the default preference applies.
If a device has an EBGP route and a local BGP route to reach the same destination, it does not select
the EBGP route because the EBGP route has a lower preference than the local BGP route by default.
You can use the network short-cut command to configure the EBGP route as a shortcut route that