set local-preference

To specify a preference value for the autonomous system path, use the set local-preference command. To delete an entry, use the no form of this command.

set local-preference number-value

no set local-preference number-value

Syntax Description

number-value
Preference value. Range: 0 to 4294967295. Default: 100.

Command Default

Preference value of 100 by default.

Command Modes

Route-map configuration mode

Command History

Release
Modification
5.0(3)N1(1)
This command was introduced.

Usage Guidelines

The preference is sent only to all routers in the local autonomous system.

You must have a match clause (even if it points to a "permit everything" list) if you want to set tags.

Use the route-map global configuration command and the match and set route-map configuration commands to define the conditions for redistributing routes from one routing protocol into another. Each route-map command has a list of match and set commands associated with it. The match commands specify the match criteria—the conditions under which redistribution is allowed for the current route-map command. The set commands specify the set actions—the particular redistribution actions to perform if the criteria enforced by the match commands are met. The no route-map command deletes the route map.

The set route-map configuration commands specify the redistribution set actions to be performed when all the match criteria of a route map are met. When all match criteria are met, all set actions are performed.

You can change the default preference value with the bgp default local-preference command.

Examples

This example shows how to set the local preference to 100 for all routes that are included in access list 1:

switch# configure terminal
switch(config)# route-map test1
switch(config-router)# route-map map-preference
switch(config-route-map)# match as-path 1
switch(config-route-map)# set local-preference 100
switch(config-route-map)#

Related Commands

Command
Description
match as-path
Matches a BGP autonomous system path access list.
route-map
Defines the conditions for redistributing routes from one routing protocol into another.
show route-map
Displays information about a route map.