[Contents]
[Prev]
[Next]
[Index]
[Report an Error]
Types of BGP Route Maps
A route map consists of match clauses and set clauses. Match clauses, which
consist of a match command, specify the
attribute values that determine whether a route matches the route
map. Set clauses, which consist of a set command, modify the specified attributes of routes that pass all
match clauses in the route map.
BGP route maps can be applied to inbound routes,
outbound routes, and redistributed routes. BGP route maps are of two
types, those that support both match and set clauses, and those that support only match clauses.
The match-and-set route maps consist of the route
maps configured with any of the commands listed in Table 15.
Table 15: Commands
That Create Match-and-Set Route Maps
|
aggregate-address attribute-map
|
global import map
|
|
bgp dampening route-map
|
neighbor route-map in
|
|
export map
|
neighbor route-map out
|
|
import map
|
redistribute route-map
|
|
global export map
|
table-map
|
BGP supports the clauses listed in Table 16 for match-and-set route maps.
Table 16: Clauses
Supported in BGP Match-and-Set Route Maps
|
match as-path
|
set as-path prepend
|
|
match community
|
set comm-list delete
|
|
match distance
|
set community
|
|
match extcommunity
|
set dampening
|
|
match ip address
|
set extcommunity
|
|
match ip next-hop
|
set ip next-hop
|
|
match level
|
set local-preference
|
|
match metric
|
set metric
|
|
match metric-type
|
set metric-type
|
|
match route-type
|
set origin
|
|
match tag
|
set tag
|
|
|
set weight
|
The match-only route maps consist of the route
maps configured with any of the commands listed in Table 17. You can use any of the match clauses listed in Table 16 in these route maps. Set clauses have no
effect in these route maps.
Table 17: Commands
That Create Match-Only Route Maps
|
aggregate advertise-map
|
aggregate support-map
|
BGP does not support the clauses listed in Table 18. However, see Applying Table Maps for exceptions for route maps applied with
the table-map command.
Table 18: Clauses
Not Supported in BGP Route Maps
|
set automatic-tag
|
set level
|
|
set distance
|
set route-type
|
match as-path
- Use to match an AS-path access list.
- The implemented weight is based on the first matched AS
path.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match as-path pathlist5
- Use the no version to delete
the match clause from a route map or a specified value from the match
clause.
- See match as-path.
match community
- Use to match a community list.
- Supported for inbound and outbound route maps.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match community comm5
- Use the no version to delete
the match clause from a route map or a specified value from the match
clause.
- See match community
match distance
- Use to match any routes that have the specified administrative
distance.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match distance 25
- Use the no version to delete
the match clause from a route map or a specified value from the match
clause.
- See match distance.
match extcommunity
- Use to match an extended community list in a route map.
- You can specify one or more extended community list names
in a match clause. If you specify more than one extended community
list, the lists are logical ORed.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match extcommunity
topeka10
- Use the no version to remove
the match clause from a route map or a specified value from the match
clause.
- See match extcommunity.
match ip address
- Use to match any route that has a destination network
number that is permitted by an access list, a prefix list, or a prefix
tree, or performs policy routing on packets.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match ip address prefix-tree
boston
- Use the no version to delete
the match clause from a route map or a specified value from the match
clause.
- See match ip address.
match ip next-hop
- Use to match any routes that have a next-hop router address
passed by the specified access list, prefix list, or prefix tree.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match ip next-hop
5 192.54.24.1
- Use the no version to delete
the match clause from a route map or a specified value from the match
clause.
- See match ip next-hop.
match level
- Use to match routes for the specified type.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match level level-1
- Use the no version to delete
the match clause from a route map or a specified value from the match
clause.
- See match level.
match metric
- Use to match a route for the specified metric value.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match metric 10
- Use the no version to delete
the match clause from a route map or a specified value from the match
clause.
- See match metric.
match metric-type
- Use to match a route for the specified metric type.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match metric-type
external
- Use the no version to delete
the match clause from a route map.
- See match metric-type.
match route-type
- Use to match a route for the specified route type.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#match route-type level-1
- Use the no version to delete
the match clause from a route map or a specified value from the match
clause.
- See match route-type.
match tag
- Use to match the tag value of the destination routing
protocol.
- Example
- host1(config)#route-map 1
- host1(config-route-map)#match tag 25
- Use the no version to delete
the match clause from a route map or a specified value from the match
clause.
- See match tag.
neighbor route-map
- Use to apply a route map to incoming or outgoing routes.
- If you specify an outbound route map, BGP advertises only
routes that match at least one section of the route map. For routes
that do not match, no further processing takes place with respect
to this peer, and those routes are not advertised to this peer. The
nonmatching route is still in the BGP RIB and can be sent to other
peers depending on the outbound policy applied to those peers.
- If you specify an inbound route map, BGP processes only
the received routes that match at least one section of the route map.
The nonmatching routes are rejected from entering the local BGP RIB
and no further processing takes place.
- A clause with multiple values matches a route having any
of the values; that is, the multiple values are logical ORed.
- If you specify a BGP peer group by using the peerGroupName argument, all the members of the peer group
inherit the characteristic configured with this command unless it
is overridden for a specific peer. However, you cannot configure a
member of a peer group to override the inherited peer group characteristic
for outbound policy.
- New policy values are applied to all routes that are sent
(outbound policy) or received (inbound policy) after you issue the
command.
To apply the new policy to routes that are already
present in the BGP routing table, you must use the clear
ip bgp command to perform a soft clear or hard clear
of the current BGP session.
Behavior is different for outbound policies configured
for peer groups for which you have enabled Adj-RIBs-Out. If you change
the outbound policy for such a peer group and want to fill the Adj-RIBs-Out
table for that peer group with the results of the new policy, you
must use the clear ip bgp peer-group command
to perform a hard clear or outbound soft clear of the peer group.
You cannot merely perform a hard clear or outbound soft clear for
individual peer group members because that causes BGP to resend only
the contents of the Adj-RIBs-Out table.
- Example
- host1(config)#rneighbor 192.168.5.34 route-map
nyc1 in
- Use the no version to remove
the route map.
- See neighbor route-map.
route-map
- Use to define the conditions for redistributing routes
from one routing protocol into another, and for filtering or modifying
updates sent to or received from peers.
- 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.
- The set commands specify the set actions—the redistribution
actions to perform if the criteria enforced by the match commands
are set.
- Use route maps when you wish to have detailed control
over how routes are redistributed between routing processes.
- The destination routing protocol is the one you specify
with the router command.
- The source routing protocol is the one you specify with
the redistribute command.
- A clause with multiple values matches a route having any
of the values; that is, the multiple values are logical ORed.
- If you specify a BGP peer group by using the peerGroupName argument, all the members of the peer group
inherit the characteristic configured with this command unless it
is overridden for a specific peer.
- Example
- host1(config)#route-map nyc1 permit 10
- Use the no version to delete
the route map.
- See route-map.
set as-path prepend
- Use to modify an AS path for BGP routes by prepending
one or more AS numbers or a list of AS numbers to the path list.
- The only global BGP metric available to influence the
best-path selection is the AS-path length. By varying the length of
the AS path, a BGP speaker can influence the best-path selection by
a peer farther away.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set as-path prepend
list list10
- Use the no version to delete
the set clause from a route map.
- See set as-path prepend.
set comm-list delete
- Use to remove communities specified by the community list
from the community attribute of routes matching the route map.
- You can use this command to delete communities only if
the community list was created with a single community per list entry
as shown in the following sample configuration for router Test:
- host1(config)#ip community-list 1 permit 231:10
- host1(config)#ip community-list 1 permit 231:20
- host1(config)#router bgp 45
- host1(config-router)#neighbor 10.6.2.5 remote-as
5
- host1(config-router)#neighbor 10.6.2.5 route-map
indelete in
- host1(config-router)#route-map indelete permit
10
- host1(config-route-map)#set comm-list 1 delete
Router Test receives the same route from
10.6.2.5 and applies the indelete route map. BGP compares each list
entry with the community attribute. A match is found for the list
entry 231:10, and this community is deleted from the community attribute.
Similarly, a match is found for the list entry of 231:20, and this
community is deleted from the community attribute.
- Use the no version to delete
the set clause from a route map.
- See set comm-list delete.
set community
- Use to set the community attribute in BGP updates.
- You can specify a community list number in the range 1–4294967295,
or in the new community format of AA:NN, or one of the following well-known
communities:
-
local-as—Prevents advertisement
outside the local AS
-
no-advertise—Prevents
advertisement to any peer
-
no-export—Prevents advertisement
beyond the BGP confederation boundary
- Alternatively, you can use the list keyword to specify the name of a community list that you previously
created with the ip community-list command.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set community no-advertise
- Use the none keyword to remove
the community attribute from a route.
- Use the no version to delete
the set clause from a route map.
- See set community.
set dampening
- Use to enable BGP route flap dampening only on routes
that pass the match clauses of, and are redistributed by, a particular
route map.
- BGP creates a dampening parameter block for each unique
set of dampening parameters—such as suppress threshold and reuse
threshold—used by BGP. For example, if you have a route map
that sets the dampening parameters to one set of values for some routes
and to another set of values for the remaining routes, BGP uses and
stores two dampening parameter blocks, one for each set.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set dampening 5 1000
1500 45 15
- Use the no version to delete
the set clause from a route map.
- See set dampening.
set extcommunity
- Use to set the extended community attributes in a route
map for BGP updates.
- You can specify a site-of-origin (soo) extended community and a route target (rt) extended community at the same time in a set clause without overwriting
the other.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set extcommunity rt
10.10.10.2:325
- Use the no version to delete
the set clause from a route map.
- See set extcommunity.
set ip next-hop
- Use to set the next hop attribute of a route that matches
a route map.
- This command is not supported for route maps used by the table-map command.
- You can specify an IP address or an interface as the next
hop.
- Use the peer-address keyword
to have the following effect:
- On outbound route maps, disables the next hop calculation
by setting the next hop to the IP address of the BGP speaker
- On inbound route maps, overrides any third-party next-hop
configuration by setting the next hop to the IP address of the peer
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set ip next-hop 192.56.32.1
- Use the no version to delete
the set clause from a route map.
- See set ip next-hop.
set local-preference
- Use to specify a preference value for the AS path.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set local-preference
200
- Use the no version to delete
the set clause from a route map.
- See set local-preference.
set metric
- Use to set the metric value—for BGP, the MED—for
a route.
- To establish an absolute metric, do not enter a plus or
minus sign before the metric value.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set metric 10
- To establish a relative metric, specify a plus or minus
sign immediately preceding the metric value. The value is added to
or subtracted from the metric of any routes matching the route map.
The relative metric value can be in the range 0–4294967295.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set metric -25
- You cannot use both an absolute metric and a relative
metric within the same route map sequence. Setting either metric overrides
any previously configured value.
- Use the no version to delete
the set clause from a route map.
- See set metric.
set metric-type
- Use to set the metric type for a route.
- For BGP, affects all types of route maps. If the route
map contains both a set metric-type and a set metric clause, the set metric clause takes precedence. Specifying the internal metric type in a BGP outbound route map, BGP
sets the MED of the advertised routes to the IGP cost of the next
hop of the advertised route. If the cost of the next hop changes,
BGP is not forced to readvertise the route.
- For BGP, you can specify the following:
-
external—Reverts to
the normal BGP rules for propagating the MED; this is the BGP default
-
internal—Sets the MED
of a received route that is being propagated to an external peer equal
to the IGP cost of the indirect next hop
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set metric-type internal
- Use the no version to delete
the set clause from a route map.
- See set metric-type.
set origin
- Use to set the BGP origin of the advertised route.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set origin egp
- Use the no version to delete
the set clause from a route map.
- See set origin.
set tag
- Use to set the tag value of the destination routing protocol.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set tag 23
- Use the no version to delete
the set clause from a route map.
- See set tag.
set weight
- Use to specify the BGP weight for the routing table.
- The weights assigned with the set weight command in a
route map override the weights assigned using the neighbor weight
and neighbor filter-list weight commands.
- Example
- host1(config)#route-map nyc1 permit 10
- host1(config-route-map)#set weight 200
- Use the no version to delete
the set clause from a route map.
- See set weight.
[Contents]
[Prev]
[Next]
[Index]
[Report an Error]