interface loopback [number]
Creates a virtual loopback interface on a router, used for router ID selection, management reachability, and testing without physical hardware.
interface loopback [number]When to Use This Command
- Setting a stable router ID for OSPF or EIGRP that doesn't depend on physical interface status
- Creating a management IP address that is always reachable via routing protocols
- Testing routing protocols and connectivity without needing physical cables
- Providing a termination point for BGP sessions or tunnel endpoints
Command Examples
Create a loopback interface and assign an IP address
interface loopback 0
ip address 10.0.0.1 255.255.255.255Router(config)# interface loopback 0 Router(config-if)# ip address 10.0.0.1 255.255.255.255 Router(config-if)# end Router# show ip interface brief Interface IP-Address OK? Method Status Protocol Loopback0 10.0.0.1 YES manual up up GigabitEthernet0/0 192.168.1.1 YES manual up up GigabitEthernet0/1 unassigned YES unset administratively down down
The 'interface loopback 0' command creates loopback 0 and enters interface configuration mode. 'ip address 10.0.0.1 255.255.255.255' assigns a /32 IP address. 'show ip interface brief' confirms the loopback is up/up, meaning it is always active. The /32 mask is typical for loopbacks.
Configure multiple loopback interfaces for OSPF router IDs
interface loopback 1
ip address 10.0.0.2 255.255.255.255
interface loopback 2
ip address 10.0.0.3 255.255.255.255Router(config)# interface loopback 1 Router(config-if)# ip address 10.0.0.2 255.255.255.255 Router(config-if)# interface loopback 2 Router(config-if)# ip address 10.0.0.3 255.255.255.255 Router(config-if)# end Router# show ip ospf Routing Process "ospf 1" with ID 10.0.0.2 ...
Multiple loopbacks can be created. OSPF automatically selects the highest IP address on a loopback as the router ID (unless manually set). Here, loopback 1's IP 10.0.0.2 becomes the OSPF router ID because it is the highest among loopbacks (10.0.0.3 is higher but loopback 2 was created after OSPF started; OSPF would need to be restarted to pick it up).
Understanding the Output
The 'show ip interface brief' output displays all interfaces, including loopbacks. The 'Status' column shows 'up' for loopbacks because they are virtual and always active unless administratively shut down. 'Protocol' is also 'up' because there is no layer 1 dependency. A loopback that is 'administratively down' indicates it was manually shut with 'shutdown'. In routing protocol outputs like 'show ip ospf', the router ID is often the highest loopback IP address. For troubleshooting, ensure loopback IPs are unique and reachable via routing. Good values: 'up/up' for status/protocol. Bad: 'administratively down' indicates a shutdown command was issued.
CCNA Exam Tips
CCNA exam tip: Loopback interfaces are always up/up unless manually shut down, making them ideal for router IDs and management.
CCNA exam tip: OSPF and EIGRP automatically use the highest IP on a loopback as the router ID; if no loopback exists, they use the highest IP on a physical interface.
CCNA exam tip: A /32 mask is standard for loopback interfaces to conserve IP addresses and simplify routing.
CCNA exam tip: You can create up to 2^32 - 1 loopback interfaces (0 to 4294967295) on Cisco IOS.
Common Mistakes
Mistake: Forgetting to assign an IP address to the loopback, leaving it unnumbered and unusable for routing protocols.
Mistake: Using a subnet mask other than /32, which can cause routing issues because loopbacks are point-to-point virtual interfaces.
Mistake: Shutting down a loopback interface with 'shutdown' command, which makes it down/down and unusable for router ID selection.
Related Commands
show ip eigrp neighbors
Displays the neighbor table for EIGRP, showing all directly connected EIGRP routers and their status, used to verify EIGRP adjacencies and troubleshoot neighbor relationships.
show ip interface brief
Displays a summary of all IP interfaces on the device, including their IP address, status, and protocol state, used for quick verification of interface configuration and connectivity.
show ip ospf
Displays general information about OSPF routing process, including router ID, areas, and LSDB statistics, used to verify OSPF configuration and operational status.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions