cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3764
Views
15
Helpful
2
Replies

Why are loopbacks advertised as /32 host ?

solemdoms5
Level 1
Level 1

Why are loopbacks advertised as /32 host ?

I have read following FAQ but I want to know the core reason for this. I mean why did cisco make it like this .

Is this just the specification ? or Is there some reason for this ? ?

http://www.cisco.com/en/US/tech/tk365/technologies_q_and_a_item09186a0080094704.shtml#qone

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

A. Loopbacks are considered host routes in OSPF, and they are advertised as /32. For more information, refer to section 9.1 of RFC 2328 . In Cisco IOS Software Releases 11.3T and 12.0, if the ip ospf network point-to-point command is configured under loopbacks, OSPF advertises the loopback subnet as the actual subnet configured on loopbacks. ISDN dialer interface advertises /32 subnet instead of its configured subnet mask. This is an expected behavior if ip ospf network point-to-multipoint is configured.

For example, consider two routers (R1 and R2) connected via FastEthernet interface. R1 has the loopback configured with the ip ospf network point-to-point command and advertises the loopback in OSPF.

interface Loopback0

ip address 1.1.1.1 255.255.255.0

ip ospf network point-to-point

When checked in router R2 with the show ip route ospf command, the route 1.1.1.1 is seen as:

!..output truncated

1.0.0.0/24 is subnetted, 1 subnets

O       1.1.1.0 [110/11] via 10.1.1.1, 00:00:02, FastEthernet0/0

However, when the ip ospf network point-to-point command is removed from R1 to 0 interface, the route 1.1.1.1 on R2 is seen as:

1.0.0.0/32 is subnetted, 1 subnets

O       1.1.1.1 [110/11] via 10.1.1.1, 00:00:01, FastEthernet0/0

2 Replies 2

NES IT
Level 1
Level 1

you cannot have two interfaces on a router within the same subnet, so they force you to put loopbacks always in unique networks (with a /32 mask). This way, loopbacks are always in their own routing space.


Dan

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

In addition to Daniel's answer, the FAQ you have quoted yourself also provides an explanation - it refers to the RFC 2328 where OSPFv2 is specified, and this RFC in Section 9.1 states:

        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.

In essence, a loopback interface is never a network because there is no other node present except the owner of the loopback itself. Therefore, even though the IOS allows us to configure loopbacks with netmasks shorter than /32 (and it does it for a good purpose because it is very convenient to, say, emulate a network using a loopback), there is really no network behind this loopback, just the router itself. So OSPF mandates that instead of announcing the reachability of the entire network on the loopback which is not really there, only the IP address of the loopback should be announced, regardless of the netmask, with the prefix length set to /32. Of course, there are situations in which it is feasible to announce loopback's true netmask, and that is when the ip ospf network point-to-point command comes handy.

Best regards,

Peter

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card