Loopback interfaces in OSPF

Loopback interfaces in OSPF

OSPF treats Loopback interfaces as STUB NETWORKS and advertise them as HOST ROUTES (with mask /32) regardless of their configured/native mask. According to RFC 2328, Host routes are considered to be subnets whose mask is "all ones (0xffffffff)". In this state, the router's interface is looped back to the network in hardware or software. In this state, the interface is unavailable for regular data traffic. However, it is still available for testing like ICMP pings and BERT. For this reason, IP packets may still be addressed to an interface in Loopback state. Such interfaces are advertised in router-LSA as single host routes, whose destination IP address is the interface address.

A router with one loopback interface generates a router-LSA with Type-1 link (stub network).

Consider the following-

R1 router-

interface Loopback 0

ip address 1.1.1.1 255.0.0.0

ip ospf 100 area 0

!

Router R2's routing table shows that the Loopback 0 is advertised with /32 mask.

R2#show ip route ospf

1.0.0.0/32is subnetted, 1 subnets

O 1.1.1.1 [110/2] via 10.1.12.1, 00:00:13, FastEthernet0/0

R1#show ip ospf interface Loopback 0

Loopback0 is up, line protocol is up

Internet Address 1.1.1.1/8, Area 0

Process ID 100, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1

Loopback interface is treated as a stub Host

To change this default behaviour, Cisco IOS lets it change to POINT-TO-POINT network type only. After the change, R2 will see the Loopback address with /8.

R1 router-

interface Loopback 0

ip address 1.1.1.1 255.0.0.0

ip ospf 100 area 0

ip ospf network-type point-to-point

!

Router R2's routing table shows that the Loopback 0 is advertised with /8 mask.

R2#show ip route ospf

O 1.0.0.0/8 [110/2] via 10.1.12.1, 00:02:08, FastEthernet0/0

R1#show ip ospf interface Loopback0

Loopback0 is up, line protocol is up

Internet Address 1.1.1.1/8, Area 0

Process ID 100, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1

Transmit Delay is 1 sec, State POINT_TO_POINT,

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

.....

Other options are a) to summarize at the ABR level and b) redistribute the connected interfaces with subnet keyword.