11-06-2012 04:54 PM - edited 03-04-2019 06:03 PM
I've been trying to be selective in the static routes I want to redistribute from static into my OSPF area. It looks like the route-map I've created is being ignored by OSPF during the redistribution process. Anybody out there know if it's possible to be selective in static route redistribution into OSPF?
Here's a sample config:
-----------------------------------------------------------------------------------
ip route 192.168.16.0 255.255.248.0 Null0 240 tag 7777 name static_summary_4redistribution
ip route 10.1.1.0 255.255.255.0 Null0 240 name test_route
!
route-map static-redistribution permit 10
match tag 7777
!
route-map static-redistribution deny 15
!
router ospf 1
redistribute static metric 9999 subnets route-map static-redistribution
------------------------------------------------------------------------------------
When I look at the route tables of other routers inside the OSPF area they all have route 192.168.16.0/21 and 10.1.1.0/24. So, the route map is not being used to filter out the static route for 10.1.1.0/24.
Any ideas?
Solved! Go to Solution.
11-06-2012 05:35 PM
I tried your config on 2 devices and it seems to be filtering out 10.1.1.0/24
here is the routing table on the neigbor router with your config:
Switch#sh ip route ospf
2.0.0.0/32 is subnetted, 2 subnets
O 2.2.2.2 [110/2] via 1.1.1.2, 00:08:05, GigabitEthernet1/0/48
O E2 192.168.16.0/21 [110/9999] via 1.1.1.2, 00:08:05, GigabitEthernet1/0/48
Switch#
Here is the routing table when I change
route-map static-redistribution deny 15
to
route-map static-redistribution permit 15
Switch#sh ip route ospf
2.0.0.0/32 is subnetted, 2 subnets
O 2.2.2.2 [110/2] via 1.1.1.2, 00:07:01, GigabitEthernet1/0/48
5.0.0.0/24 is subnetted, 1 subnets
O E2 5.5.5.0 [110/9999] via 1.1.1.2, 00:04:38, GigabitEthernet1/0/48
10.0.0.0/24 is subnetted, 1 subnets
O E2 10.1.1.0 [110/9999] via 1.1.1.2, 00:04:38, GigabitEthernet1/0/48
O E2 192.168.16.0/21 [110/9999] via 1.1.1.2, 00:07:01, GigabitEthernet1/0/48
HTH
11-06-2012 05:35 PM
I tried your config on 2 devices and it seems to be filtering out 10.1.1.0/24
here is the routing table on the neigbor router with your config:
Switch#sh ip route ospf
2.0.0.0/32 is subnetted, 2 subnets
O 2.2.2.2 [110/2] via 1.1.1.2, 00:08:05, GigabitEthernet1/0/48
O E2 192.168.16.0/21 [110/9999] via 1.1.1.2, 00:08:05, GigabitEthernet1/0/48
Switch#
Here is the routing table when I change
route-map static-redistribution deny 15
to
route-map static-redistribution permit 15
Switch#sh ip route ospf
2.0.0.0/32 is subnetted, 2 subnets
O 2.2.2.2 [110/2] via 1.1.1.2, 00:07:01, GigabitEthernet1/0/48
5.0.0.0/24 is subnetted, 1 subnets
O E2 5.5.5.0 [110/9999] via 1.1.1.2, 00:04:38, GigabitEthernet1/0/48
10.0.0.0/24 is subnetted, 1 subnets
O E2 10.1.1.0 [110/9999] via 1.1.1.2, 00:04:38, GigabitEthernet1/0/48
O E2 192.168.16.0/21 [110/9999] via 1.1.1.2, 00:07:01, GigabitEthernet1/0/48
HTH
11-07-2012 08:14 AM
Hi Reza - Thanks for confirming this will indeed work. I just tested the config on a third router (ISR G2 2911 running ver 15.1(4)M4) and it works fine. I think I was hitting a bug on both test routers (ISR G1 2821) since they were running 12.4(15)T17 and T15.
One last question, when you do a "show route-map" do you see any packets being processed? Here's my output from the working router:
---------------------------------------------------------------------
testrouter#sh route-map
route-map static-redistribution, permit, sequence 10
Match clauses:
tag 7777
Set clauses:
Policy routing matches: 0 packets, 0 bytes
route-map static-redistribution, deny, sequence 15
Match clauses:
Set clauses:
Policy routing matches: 0 packets, 0 bytes
-----------------------------------------------------------------------
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