Loopback Interface Overview
The Internet Protocol (IP) specifies a loopback network with the (IPv4) address
127.0.0.0/8
. Most IP implementations support a loopback interface
(lo0
) to represent the loopback facility. Any traffic that a
computer program sends on the loopback network is addressed to the same computer. The
most commonly used IP address on the loopback network is 127.0.0.1
for
IPv4 and ::1
for IPv6. The standard domain name for the address is
localhost
.
A network device also includes an internal loopback interface
(lo0.16384
). The internal loopback interface is a particular instance
of the loopback interface with the logical unit number 16384.
You use the loopback interface to identify the device. While you can use any interface address to determine if the device is online, the loopback address is the preferred method. Whereas interfaces might be removed or addresses changed based on network topology changes, the loopback address never changes.
When you ping an individual interface address, the results do not always indicate the health of the device. For example, a subnet mismatch in the configuration of two endpoints on a point-to-point link makes the link appear to be inoperable. Pinging the interface to determine whether the device is online provides a misleading result. An interface might be unavailable because of a problem unrelated to the device configuration or operation. You can use the loopback interface to address these issues.
Junos OS Evolved supports two different filters to control the flow of local packets: one for network control traffic (loopback traffic) and one for management traffic. For additional information, see Top Differences Between Junos OS Evolved and Junos OS.
Benefits
-
As the loopback address never changes, it is the best way to identify a device in the network.
-
The loopback interface is always up and reachable as long as the route to that IP address is available in the IP routing table. Hence, you can use the loopback interface for diagnostics and troubleshooting purposes.
-
Protocols such as OSPF use the loopback address to determine protocol-specific properties for the device or network. Further, some commands such as
ping mpls
require a loopback address to function correctly. -
Junos OS creates a separate loopback interface for the internal routing instance, which prevents any filter on
lo0.0
from disrupting internal traffic.