11-17-2004 05:11 AM - edited 03-02-2019 08:01 PM
ip prefix-list PL-OUT seq 5 permit 192.168.1.0/24 le 32
ip prefix-list PL-OUT seq 10 permit 192.168.2.0/24 le 32
ip prefix-list PL-OUT seq 15 permit 192.168.3.0/24 le 32
ip prefix-list PL-OUT seq 20 permit 192.168.4.0/24 le 32
!
ip as-path access-list 10 permit ^$
!
route-map ActiveLink_Out permit 10
match as-path 10
set metric 1000
set community 65000:1
!
route-map ActiveLink_Out permit 15
match ip address prefix-list PL-OUT
set as-path prepend 65000
!
In this example, Please could someone clarify that the route-map will not move onto line 15.
If this is the case, how does the "route-map" know that within the permit ^$, all routes have been matched.
Say if the ACL 10 had permit _65000_ instead of permit all?
ip as-path access-list 10 permit _65000_
The route-map would continue to line 15? Correct?
Im a little confused with the logic and how it works?
Route maps have the following common characteristics:
-Route maps are executed in the order of the lowest sequence number to the highest.You
can edit or modify maps by using the sequence number.
-If a match is found within a route map instance,execution of further route map instances
stops.
-You can use route maps to permit or deny the information found true by the match
statements.
-If multiple match statements are called within a single route map instance,all match
statements must match for the route map instance to yield a true result.
-If route maps are applied in a policy-routing environment,packets that do not meet the
match criteria are then forwarded according to the route table.
-If there is no match statement in the route map instance,all routes and packets are
matched.The set statement will apply to all routes or packets.
-If there is not a corresponding ACL to the match statement in the route map instance,all
routes are matched.The set statement,in turn,applies to all routes.
-As with ACLs,an implicit deny is included at the end of the route map policy.
11-17-2004 05:40 AM
First ^$ is not a match all. It is rather a match on an empty AS-PATH (locally originated prefixes). permit .* is a permit all.
If you were to configure a permit all in instance 10 then no prefix would make it to instance 15.
In the case you specify _65000_ and that this condition is not met by a given prefix, instance 15 would be evaluated for that same prefix.
Hope this helps,
11-17-2004 06:42 AM
So Mr H Ritter, and thx very much for your excellent replies.
If there is any match on seq 10, the route-map stops processing. Is that the correct assumption.
The only way that it would move onto seq 15, if it did not match anything in the match statement.
so, how could I set two BGP attributes in a route-map, I would have to do it in the same seqeunce correct?
hope I am not being two dumb here.
Kind regards,
Ken
11-17-2004 08:06 AM
I AM A MUPPET!
Right, for this to work, I need to think of a route-map like an access-list.
each packet will go in/out of the interface, and then the acl will be read for eachpacket eiether with a match or no match.
route-map, each prefix that gets advertised via redist, or a neighbor route-map command will go throught the route-map and either being matched or not matched.
thats the logic I have got lost on. soooo sorry.
so if i wanted my route-map to work, with both of these statements, i would have to do the following.
route-map ActiveLink_Out permit 10
match ip address prefix-list PL-OUT
set metric 1000
set community 65000:1
!
route-map ActiveLink_Out permit 15
match as-path 10
set as-path prepend 65020
set metric 1000
set community 65000:1
This is correct is it not?
So if it did not match the prefix-list, it would go onto the next statement and match the as-path acl.
Sorry if I appear really dumb but i need a new job!!
Cheers Ken
11-17-2004 08:30 AM
Your logic seems to be correct. Is your as-path access-list 10 a match all? if so you would also have the same result by not specifying a match statement at all under seq 15:
route-map ActiveLink_Out permit 15
set as-path prepend 65020
set metric 1000
set community 65000:1
Dont we all need a new job ;o)
11-17-2004 08:17 AM
Ken,
You are correct on all counts (except for the being dumb part of course).
You can change this default behavior by using the continue statement. This allow for greater flexibility when building complex route-maps.
For more information on how to use the continue statement, please refer to the following link:
http://www.cisco.com/univercd/cc/td/doc/product/software/ios123/123newft/123t/123t_2/gt_brmcs.htm
Hope this helps,
11-18-2004 02:58 AM
Great - many many thx. this has been a great help. off to the job center now :)
beers are in the post, so we can all get drunk.
Cheers fella
Ken
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide