Why do we use the ip ospf network point-to-point command on loopback interfaces?

interface Loopback0
 ip address
 ip ospf network point-to-point

kindly explain that..


3 Answers 3


If we create a loopback and give classful or classless addresses, then by default the route to that loop back is advertised as the most specific route: /32 prefix and it will ignore any configured prefix.


interface Loopback0
 ip address

Here, the loopback network address is By default OSPF will advertise this route to loopback0 as (most specific route to that loopback).

To override this we have to change the network type to point-to-point. After this OSPF will advertise the address to loopback as

interface Loopback0
 ip address
 ip ospf network point-to-point

By using point-to-point command you will be overriding the default categorization of OSPF.

Per RFC 2328, OSPF only supports following types of links:

               Link type   Description       Link ID
               1           Point-to-point    Neighbor Router ID
               2           Link to transit   Interface address of
                           network           Designated Router
               3           Link to stub      IP network number
               4           Virtual link      Neighbor Router ID

Loopback interfaces fall in link-type 3: the stub network. The RFC states:

            If the state of the interface is Loopback, add a Type 3
            link (stub network) as long as this is not an interface
            to an unnumbered point-to-point network.  The Link ID
            should be set to the IP interface address, the Link Data
            set to the mask 0xffffffff (indicating a host route),
            and the cost set to 0.



Since there are only two routers on a point-to-point link, there is no need to hold an election for a Designated Router (DR) and a backup DR as OSPF would in a broadcast network.

An OSPF router on a point-to-point link will multicast its OSPF on the link for the other end to receive. On a point-to-point link, a router can only establish one neighborship.

A loopback interface in OSPF will be in loopback mode. Setting OSPF to point-to-point mode results in advertised routes containing the actual subnet mask instead of the default behaviour of advertising /32 for a loopback interface.

Iirc I read something about scenarios in which advertising a /32 instead of the actual mask causes trouble. I have only ever used this to start advertising a network that was not yet attached to the router.

  • Could you comment on the reason for using this configuration on a loopback? Nov 19, 2014 at 13:59
  • I believe that's typically done when a loopback is configured with a mask with something other than a /32. By default, OSPF will advertise the loopback network as a /32 regardless of the actual mask configured. However, with the "ip ospf network point-to-point" configured on the loopback, the actual mask of the interface will be advertised. However, in this case, I don't see any benefit of the command, as it will be advertised as a /32 either way.
    – Ryan
    Nov 19, 2014 at 14:37
  • @Mike @ Ryan if we give the ip ospf network point-to-point it changes the default mask to real mask we configured.my question is is there any calculation behind that command?
    – Trojan
    Nov 19, 2014 at 16:15
  • @Mike, @ Trojan Sorry, I missed the (important) part about the loopback interface when I first replied.
    – Gerben
    Nov 19, 2014 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.