02-06-2013 05:51 AM - edited 03-07-2019 11:32 AM
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
02-06-2013 06:21 AM
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
02-06-2013 06:58 AM
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
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