background image
Creating BGP Policies
331
We must now match conditions. Let's assume that previously we set an
access list for the AS_PATH attribute numbered 6, permitting only the IP
network 172, as shown below:
RouterA(config-router)# ip as-path access-list 6 permit
172
We then need to add a match statement to allow us to use this in our route
map, as shown below:
RouterA(config)#route-map routemap1 permit 10
RouterA(config-route-map)#match as-path 6
We now can use a set statement to add a local preference of 50 to all the
matching routes:
RouterA(config)#route-map routemap1 permit 10
RouterA(config-route-map)#match as-path 6
RouterA(config-route-map)#set local-preference 50
Upon creating this list, we have effectively denied all the other routing
updates including all the non-route updates. In order to keep those non-
update packets going through our router, we need to create a permit route
map, which we will number 25, as shown below:
RouterA(config)#route-map routemap1 permit 25
Statements in a route list are processed from the top down just like a standard
or extended access list. If a match is found for a route, the set conditions are
applied and the match is no longer looked for. The sequence number is used
only for inserting or deleting specific route-map statements.
Just like in ACLs, there is an implicit deny any at the end of a route map.
If all the statements in the route map are checked and there are no matches,
then there is an automatic denial of the route. The following are the match
and set commands that can be used for route maps:
match as-path
match community
match clns
Copyright ©2001 SYBEX , Inc., Alameda, CA
www.sybex.com