02-03-2010 11:23 AM - edited 03-04-2019 07:23 AM
I want to distribute some static routes to an OSPF neighbor on the same subnet, but only that one neighbor--I have two other neighbor relationships. Is there a way to redistribute static routes to only one neighbor--with a route-map maybe, or another way?
Thanks,
James
02-04-2010 05:11 AM
Another way of doing it might be, assign different area to the router you want to send prefix than the other neighbors (who you don't want to send prefixes). then on area boundry of the routers where you don't want routes to be advertised, apply a filter-list that way routes will not go to lsdb and not to routing table.
02-04-2010 05:26 AM
Hello Shahzad,
inter area filtering works only for internal routes, external OSPF routes cannot be filtered in this way and original poster was speaking of static routes redistributed into OSPF.
In other cases what you suggest is feasible and it is a good reason for using network ... area commands + passive interface instead of redistribute connected: it provides more control
Hope to help
Giuseppe
02-04-2010 06:44 AM
Hi Giuseppe,
Sure you are right, that solution is only for inter-area routes - missed routes we are talking here are RED routes.
You can still filter routes using forward address filters. Here is the idea:
For all redistributed routes in normal areas (not NSSA) ospf records forward address of 0.0.0.0 but if you filfill following conditions ospf will start using next hop address of ASBR. Conditions are:
1. ASBR's next hop interface should be included in ospf process
2. Next hop interface should not be point-to-point
3. Next hop interface should not be point to multipoint
4. interface address should not be included using redistribution.
if these conditions are met router records next hop address instead of 0.0.0.0 (and this way just using advertising router as next hop). Now all the downstream routers will record the red routes as far as they have reachability to the next hop advertising. If you divide the router you want prefixes go through in separate then other routers. you can filter next hop address on area boundry of routers not required to have redistributed routes. this way these routers will not receive next hop address for ASBR and will hence not install external routes.
Example:
R1#s
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 172.16.10.1 YES manual up up
Serial0/0 10.10.10.1 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
Serial0/1 10.10.10.5 YES manual up up
Loopback5 5.5.5.5 YES manual up up
R1#sh run | b router ospf
router ospf 1
log-adjacency-changes
area 2 filter-list prefix filter-external in
redistribute static subnets
network 10.10.10.0 0.0.0.3 area 1
network 10.10.10.4 0.0.0.3 area 2
network 172.16.10.1 0.0.0.0 area 0
------
R2#sh run | b router ospf
router ospf 1
log-adjacency-changes
network 10.10.10.0 0.0.0.3 area 1
O E2 192.168.30.0/24 [110/20] via 10.10.10.1, 00:13:09, Serial0/0
O E2 192.168.10.0/24 [110/20] via 10.10.10.1, 00:13:19, Serial0/0
172.16.0.0/24 is subnetted, 1 subnets
O IA 172.16.10.0 [110/74] via 10.10.10.1, 00:23:48, Serial0/0
O E2 192.168.20.0/24 [110/20] via 10.10.10.1, 00:13:14, Serial0/0
10.0.0.0/30 is subnetted, 3 subnets
C 10.10.10.12 is directly connected, Serial0/1
C 10.10.10.0 is directly connected, Serial0/0
O IA 10.10.10.4 [110/128] via 10.10.10.1, 00:33:52, Serial0/0
------
R3#sh run | b router ospf
router ospf 1
log-adjacency-changes
network 10.10.10.4 0.0.0.3 area 2
C 10.10.10.8 is directly connected, Serial0/1
O IA 10.10.10.0 [110/128] via 10.10.10.5, 00:12:32, Serial0/0
C 10.10.10.4 is directly connected, Serial0/0
********
you can see R2 is having external routes but R3 don't.
Shahzad.
04-02-2012 05:37 PM
Hey James,
I believe the answer is pretty simple. You can tag all the static routes you want to distribute to a certain neighbor with tag value 100 for instance and use a route-map under ospf doing the following
On the neighbor you want to receive those certain routes, configure a route-map that matches the source of updates with tag 100
route-map AllowRoutes permit 10
match ip route-source x.x.x.x
match tag 100
while on the other 2 neighbors, configure route-maps that permit everything except the static route
route-map OmitRoutes deny 10
match ip route-source x.x.x.x
match tag 100
The problem is that you can't control which neighbor will be a recipient for some particular routes from the source of updates. However, you can control the recipients to allow certain routes or not.
Hope this helps, my first post ever
Wassim
CCNP
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