0 ROUTE MAPSAT THIS POINT I WOULD LIKE TO INTRODUCE ROUTE MAPS BECAU...
6.0 Route Maps
At this point I would like to introduce route maps because they will be
used heavily with BGP. In the BGP context, route map is a method used to
control and modify routing information. This is done by defining condi-
tions for redistributing routes from one routing protocol to another or
controlling routing information when injected in and out of BGP. The for-
mat of the route map follows:
route-map
map-tag [[permit | deny] | [sequence-number]]
The map-tag is just a name you give to the route-map. Multiple instances
of the same route map (same name-tag) can be defined. The sequence number
is just an indication of the position a new route map is to have in the
list of route maps already configured with the same name.
For example, if I define two instances of the route map, let us call it
MYMAP, the first instance will have a sequence-number of 10, and the
second will have a sequence number of 20.
route-map MYMAP permit 10
(first set of conditions goes here.)
route-map MYMAP permit 20
(second set of conditions goes here.)
When applying route map MYMAP to incoming or outgoing routes, the first
set of conditions will be applied via instance 10. If the first set of
conditions is not met then we proceed to a higher instance of the route
map.
The conditions that we talked about are defined by the match and set
configuration commands. Each route map will consist of a list of match
and set configuration. The match will specify a match criteria and set
specifies a set action if the criteria enforced by the match command are
met.
For example, I could define a route map that checks outgoing updates and
if there is a match for IP address 1.1.1.1 then the metric for that
update will be set to 5. The above can be illustrated by the following
commands:
match ip address 1.1.1.1
set metric 5
Now, if the match criteria are met and we have a permit then the routes
will be redistributed or controlled as specified by the set action and we
break out of the list.
If the match criteria are met and we have a deny then the route will not
be redistributed or controlled and we break out of the list.
If the match criteria are not met and we have a permit or deny then the
next instance of the route map (instance 20 for example) will be checked,
and so on until we either break out or finish all the instances of the
route map. If we finish the list without a match then the route we are
looking at will not be accepted nor forwarded.
One restriction on route maps is that when used for filtering BGP updates
(as we will see later) rather than when redistributing between protocols,
you can NOT filter on the inbound when using a “match” on the ip address.
Filtering on the outbound is OK.
The related commands for match are:
match as-path
match community
match clns
match interface
match ip address
match ip next-hop
match ip route-source
match metric
match route-type
match tag
The related commands for set are:
set as-path
set automatic-tag
set community
set clns
set interface
set default interface
set ip next-hop
set ip default next-hop
set ip precedence
set tos
set level
set local-preference