
OSPF : distribute-list and route-map
Hi all,
Is it possible to use set command within route-map that is bound with distribute-list ?
For example, i tried to change OSPF route type of default routes that are sourced from different routers. FOr instance, default route that is sourced from router B will be external type 1 meanwhile default route that is sourced from router C will be external type 2. The goal is to prefer the default route from router B. I tried using below config, but however i still can see all default routes that are sourced from both routers (B and C).
Here is the config that i tried
ip prefix-list default-route seq 5 permit 0.0.0.0/0
access-list 10 permit 172.24.255.12 log //router B address
access-list 20 permit 172.24.255.13 log //router C address
route-map defroute permit 10
match ip address prefix-list default-route
match ip route-source 10
set metric-type type-1
!
route-map defroute permit 20
match ip address prefix-list default-route
match ip route-source 20
set metric-type type-2
!
route-map defroute permit 30
router ospf 100
router-id 172.24.255.10
log-adjacency-changes
network 172.24.0.0 0.0.255.255 area 0
distribute-list route-map defroute in
!
So, anyone who can help me out, i do really appreciate
Regards
Wisnu
Comments
No, unfortunately you cannot do set cmds on a route-map applied to a inbound distribute-list.
See http://cisco.com/en/US/docs/ios/iproute/configuration/guide/irp_ospf_inbound_ps6350_TSD_Products_Configuration_Guide_Chapter.html
The only way I could get this to work by configuring only the receiving router is by lowering the AD for all routes from that neighbor. It is a bit lame, I know :-)
It should be much easier to do on the sending routers, lab permitting.
It is a good question, any other ideas guys?
Hi Nicola,
Thanks for your input.
Yes i fully agree with you that it will be easier to do the manipulation on the sending routers, but if we want to add additional CPE which should prefer to reach router C then we will have the problem.
Anyhow, lowering AD seems to work for this particular case. Very thanks for the information, but still is there any other way we can do to manipulate OSPF route on the receiving end ?
Best Regards
Wisnu
Have a look at this http://www.nil.si/ipcorner/OSPFDefaultMysteries/
Try changing the ospf cost of the routes to B and C. Athough the type 2 cost is the same, the router will take into account the ospf cost to the ASBR advertising the external route.