The preference command sets a priority for EBGP routes, IBGP routes, or local BGP routes. BGP routes are configured with different priorities in different address family views.
The undo preference command restores the default setting.
By default, the priorities of EBGP routes, IBGP routes, and local BGP routes are all 255.
Parameter | Description | Value |
---|---|---|
external |
Specifies a protocol preference of an EBGP external route. EBGP routes are the optimal routes learned from peers outside the local AS. |
The value is an integer that ranges from 1 to 255. A smaller value indicates a higher priority. |
internal |
Specifies a protocol preference of an IBGP internal route. An internal route is a route learned from a peer in an AS. |
The value is an integer ranging from 1 to 255. The smaller the value is, the higher the priority is. |
local |
Specifies a protocol preference of a local BGP route. |
The value is an integer that ranges from 1 to 255. A smaller value indicates a higher priority. This parameter takes effect for the following routes:
For details about how to identify the preceding types of routes, see Precautions. |
route-policy route-policy-name |
Specifies the name of a route-policy. |
The value is a string of 1 to 200 case-sensitive characters without spaces. If the character string is quoted by double quotation marks, the character string can contain spaces. |
route-filter route-filter-name |
Specifies the name of a route-filter. |
The value is a string of 1 to 200 case-sensitive characters, spaces not supported. If parameters are included in the referenced route-filter, specify values for them in the format of (var1, var2, ...var8) behind the route-filter name. A maximum of eight parameters can be specified, and each value ranges from 1 to 200 characters. |
Usage Scenario
Running the preference command to set priorities for BGP routes affects route selection among BGP routes and routes of other routing protocols.
After a route-policy or route-filter is configured on a device, the device sets priorities only for the routes received from peers, which meet the matching rules. The routes that do not meet the rules use the default priority. The smaller the priority value, the higher the priority.Prerequisites
Create the route-policy first if the preference command uses the route-policy to set priorities.
Perform the following steps when the route-policy is used to set priorities:Configuration Impact
The preference route-policy command is mutually exclusive with the preference route-filter command.
Precautions
Currently, the peer route-policy or peer route-filter command cannot be used to apply a route-policy to setting priorities for BGP routes.
The preference command cannot configure a priority for routes imported using the network command or the import-route command. If a route is imported to BGP as a BGP route using the network or import-route command, the BGP route inherits the priority of the imported route. In this command, the local parameter specifies a priority for summary routes and leaked routes. This parameter takes effect for the following routes: