Why are loopbacks advertised as /32 host routes in OSPF?

Unanswered Question
Jan 31st, 2007

Why are loopbacks advertised as /32 host routes in OSPF?

thanks!!!

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (1 ratings)
Loading.
mheusinger Wed, 01/31/2007 - 04:53

Hi,

it depends on the network type of the Loopback interface. Funny enough you could say. To get f.e. a /24 in OSPF from a Loopback use the following config:

interface Loopback0

ip address 10.1.1.1 255.255.255.0

ip ospf network point-to-point

router ospf1

network 10.1.1.1 0.0.0.0 area 0

Regards, Martin

Richard Burts Wed, 01/31/2007 - 07:58

Martin has provided a good answer about how to change what the IOS will advertise in OSPF for a loopback interface. But he did not address the original question of why the IOS implementation of OSPF advertises a loopback as /32 irrespective of the subnet mask configured on the interface. I believe that the reason is that IOS knowing that OSPF needs an accurate understanding of the topology, and knowing that for a loopback interface there will not be any other addresses used in that subnet of the loopback, chose to advertise as a /32 reflecting that the host address is the only real address used in that subnet.

There are sometimes reasons why we want OSPF to advertise the subnet of the loopback, and Martin's post shows how to do that. But for the most accurate understanding of what the topology really is, the loopback is a host address.

HTH

Rick

mheusinger Wed, 01/31/2007 - 08:30

Hi all,

Rick you are right, I just was drawn from the post due to my work. So here comes the rest:

Actually this behaviour is described in RFC 2328 (OSPF) section 9.1:

Loopback

In this state, the router's interface to the network is looped back. The interface may be looped back in hardware or software. The interface will be unavailable for regular data traffic. However, it may still be desirable to gain information on the quality of this interface, either through sending ICMP pings to the interface or through something like a bit error test. For this reason, IP packets may still be addressed to an interface in Loopback state. To facilitate this, such interfaces are advertised in router-LSAs as single host routes, whose destination is the IP interface address.[4]

Regards, Martin

Actions

This Discussion