cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
755
Views
0
Helpful
2
Replies

Redistribute Local /32 via OSPF

supernuller
Level 1
Level 1

Hello,

I'm currently trying to find out if there's a way to use ospf to redistribute the /32 ip address that's assigned to an interface with a /24 address. This would be useful as I have a core router (R1) that has two point-point links that connect to two distribution switches (R2 and R3 in this example their just routers)  Between R2 and R3 is a network 5.5.5.0/24 which would be used for client devices. 5.5.5.1 will be used for HSRP (gateway). 5.5.5.2 for R2 primary IP and 5.5.5.3 for the primary IP on R3. OSPF cost is 0 on all interfaces.

How it works:

Traffic enters R1 over various other links not pictured. The traffic is destined for the 5.5.5.0/24  R1 looks at the RIB and sees there are 2 routes to 5.5.5.0/24 and since the cost is equal it alternates between them. The traffic is then delivered to the client devices on the 5.5.5.0/24 network. This all works fine and well except when:

If the destination of the traffic is the interface IP of (R2 5.5.5.2 or R3 5.5.5.3). For example if traffic was destined for 5.5.5.3 R1 will look in the RIB and see the route for the 5.5.5.0/24 and choose to alternate the traffic between R2 and R3. When in actuality it would have been better to send the traffic directly to R3 so you don't add an additional hop. This also causes trace routes to be erratic.

The fix?:

What I would like to do is have ospf advertise the /32 interface IPs as well as the /24 for the customer routes. So if traffic is destined for 5.5.5.3 ip it will look in the RIB and see the entry that got redistributed via OSPF for 5.5.5.3/32 and see that there's only one path the direct link to R3. Since longer prefixes are usually preferred in the RIB and the /32 prefix will be preferred over the 5.5.5.0/24 RIB entry.

I've tried a bunch of things to enable the sending of the /32 but It appears that IOS intentionally stops you from doing just that. Here's what I've tried:

creating a static route on R3:

router ospf 100

redistribute static subnets

exit

ip route 5.5.5.3 255.255.255.255 gi1/0

The above config does work but only if the static route isn't to the actual interface IP.

This doesn't work for some reason. The reason I think this doesn't work is because in the RIB on R3 there is a Local Route already for the same /32 with an admin distance of 0. Since a local route has an AD of 0 the static route doesn't even enter the RIB. And I'm thinking the OSPF redistribution only looks at static routes that are in the RIB. Neither would "redistribure connected subnets" since that only sends connected routes and not local routes since you typically wouldn't want to redistribute local routes as that would clutter the RIB and be completely unnecessary.

If any of you know any work around that would be great Thanks!!

  

2 Replies 2

Philip D'Ath
VIP Alumni
VIP Alumni

What about if you just do "redistribute connected" ?

Hello Philip,

I tried that as well but it ended up not making a difference since the connected route is for the full /24. Only the local route is for the /32 and the static which isn't used.

Thanks!!

Review Cisco Networking products for a $25 gift card