A loopback interface is a virtual, software-based router interface. It remains up and reachable while the device is operational, unless an administrator uses shutdown. Unlike a physical interface, it does not depend on one particular port or physical connection. section 18.2.1 section 18.5
Loopback interfaces matter in OSPF because they can provide a stable address for the router ID (RID):
- OSPF selects the RID in this order: manually configured router-id, highest address on an operational loopback interface, then highest address on an operational physical interface. section 18.2.1 section 18.5
Configuring Loopback0 for OSPF
R2(config)# interface l0 R2(config-if)# ip address 172.16.1.2 255.255.255.255 R2(config-if)# router ospf 1 R2(config-router)# do show ip protocols Router ID 172.16.1.2 Because Loopback0 is operational and has an address, OSPF uses 172.16.1.2 as R2’s RID.

