04-19-2012 10:06 AM - edited 03-04-2019 04:05 PM
Hi All,
I have a network setup wherein BGP routes are redistributed onto the OSPF process.
router ospf 1
redistribute bgp 100 metric-type 1 subnets route-map ABC
route-map ABC permit 10
match ip address 15
set metric 50
!
route-map DMZ-MPLS-route permit 20
set metric 200
access-list 15 deny 1.1.1.0 0.0.0.255
access-list 15 deny 2.2.2.0 0.0.0.255
access-list 15 deny 3.3.3.0 0.0.0.255
access-list 15 deny 4.4.4.0 0.0.0.255
permit any
Now, since the ACL15 is denying subnets,
1) Does that mean that the first route-map clause (permit 10) does not get used, and it goes to the next clause (permit 20). This would then mark all the routes getting redistibutred into OSPF with a metric of 200
OR
2) The route-map checks ACL 15, matches the "permit any" statement in the end, and sets a metric of 50 for the routes getting redistributed into OSPF?
Please clarify.
Thanks
Mikey
04-19-2012 10:14 AM
Mikey
Your question talks about sequence 10 going to sequence 20. But sequence 10 is in one route map and sequence 20 is in a different route map. So it would not go from sequence 10 to sequence 20. If you want it to go from sequence 10 to sequence 20 then both of them must be in route map ABC.
your 1) is not the way that it works.
your 2) is the way that it works. It would not redistribute 1.1.1.0 or 2.2.2.0 or 3.3.3.0 or 4.4.4.0 and all other routes will be redistributed with metric 50.
HTH
Rick
04-19-2012 11:28 AM
Hi Rick,
Thanks for your reply. The Route-maps are the same "ABC" (it's a type error). Sorry about that.
Will it still work like option 2 as you mentioned?? (Even if the Route-map name is the same)
Thanks
Mikey
04-20-2012 03:15 AM
Hi,
Could anyone please reply to my query above.
Appreciate your help.
Thanks
Mikey
04-20-2012 07:02 AM
Mikey,
Rick already replied with the correct answer.
Option 2 will be the expected behavior.
04-20-2012 08:20 AM
Thanks for confirming Edison.
So, this would mean the 2nd Route-map clause (permit 20) is useless? Since only those four subnets are getting denied, and rest permitted subnets get a metric of 50, there is no way the route-map would consider looking at the 2nd clause?
Please correct me if Iam wrong.
Thanks
Mikey
04-20-2012 09:24 AM
What exactly are you trying to accomplish?
It seems you want every subnet to have Metric 50 with the exception of those subnets?
If so, the first route-map entry is doing its job.
Then you also want every subnet to have Metric 200 ?
It makes no sense there..
04-20-2012 11:58 AM
The use of the ACL is to prefer routes being redistributed from one Service provider over the other.
I haven't configured these route-maps. They have been in my network setup for a long time. Even I couldn't understand the actual usage of sequence "permit 20", and hence needed to clarify in the forum here.
Thanks
MIkey
04-20-2012 12:10 PM
Hi,
the prefixes matching the ACL 15 will get the metric 50 by the route-map sequence 10.
The prefixes not matching the ACL 15 (i.e., those denied by it) will get the metric 200 by the route-map sequence 20.
I'd probably use a reverse logic to get the same efect:
route-map ABC permit 10
match ip address 15
set metric 200
!
route-map ABC permit 20
set metric 50
!
access-list 15 permit 1.1.1.0 0.0.0.255
access-list 15 permit 2.2.2.0 0.0.0.255
access-list 15 permit 3.3.3.0 0.0.0.255
access-list 15 permit 4.4.4.0 0.0.0.255
!
But it's just a question of personal style how to write Cisco configs.
HTH,
Milan
04-20-2012 12:34 PM
Hi Milan,
It sure does make sense now. I would definitely go with your logic if given a chance. Saves everyone all the confusion.
Appreciate your inputs.
Thanks
Mikey
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