You can specify a software-only interface called a loopback interface to emulate a physical interface. Loopback interfaces
are supported on all platforms. A loopback interface is a virtual interface on a Cisco router that remains up (active) after
you issue the no shutdown command until you disable it with the shutdown command. Unlike subinterfaces, loopback interfaces are independent of the state of any physical interface.
The loopback interface can be considered stable because once you enable it, it will remain up until you shut it down. This
makes loopback interfaces ideal for assigning Layer 3 addresses such as IP addresses when you want a single address as a reference
that is independent of the status of any physical interfaces in the networking device. A good example of this is using the
IP address of a loopback interface as the IP address for the domain name system (DNS) host address for the networking device.
Before loopback interfaces were available, network administrators had to configure a DNS host entry for every interface on
a router that had an IP address assigned to it because they could never be certain which interface IP address might be available
at any given time for managing the router. In the sample interface configuration and DNS entries for Router A shown below,
you can see that there is a DNS entry for each interface.
Router A Interface Configuration Before Loopback
GigabitEthernet0 10.10.10.1 255.255.255.0
GigabitEthernet1 10.10.11.1 255.255.255.0
GigabitEthernet2 10.10.12.1 255.255.255.0
GigabitEthernet3 10.10.13.1 255.255.255.0
GigabitEthernet4 10.10.14.1 255.255.255.0
GigabitEthernet5 10.10.15.1 255.255.255.0
Router A DNS Entries Before Loopback
RouterA IN A 10.10.10.1
IN A 10.10.11.1
IN A 10.10.12.1
IN A 10.10.13.1
IN A 10.10.14.1
IN A 10.10.15.1
Interfaces on networking devices can fail, and they can also be taken out of service for maintenance. If any of the interfaces
in Router A fails or is taken out of service, another networking device will not be able to access that interface. When you
configure a networking device with a loopback interface and assign it an IP address that is advertised throughout the network,
the networking device will be reachable by using this IP address as long as the networking device has at least one network
interface capable of sending and receiving IP traffic. In the sample interface configuration and DNS entries for Router A
after a loopback interface is configured, you can see that there is now only one DNS entry that can be used to reach the router
over any of its physical interfaces.
Router A Interface Configuration After Loopback
Loopback 172.16.78.1 255.255.255.0
GigabitEthernet0 10.10.10.1 255.255.255.0
GigabitEthernet1 10.10.11.1 255.255.255.0
GigabitEthernet2 10.10.12.1 255.255.255.0
GigabitEthernet3 10.10.13.1 255.255.255.0
GigabitEthernet4 10.10.14.1 255.255.255.0
GigabitEthernet5 10.10.15.1 255.255.255.0
Router A DNS Entries After Loopback
RouterA IN A 172.16.78.1
The configured IP address of the loopback interface--172.16.78.1--can be used as the source address for packets generated
by the router and forwarded to networking management applications and routing protocols. Unless this loopback interface is
explicitly shut down, it is always reachable.
You can use the loopback interface as the termination address for open shortest path first (OSPF) or border gateway protocol
(BGP) sessions. A loopback interface can also be used to establish a Telnet session from the console port of the device to
its auxiliary port when all other interfaces are down. In applications where other routers or access servers attempt to reach
this loopback interface, you should configure a routing protocol to distribute the subnet assigned to the loopback address.
IP Packets routed to the loopback interface are rerouted back to the router or access server and processed locally. IP packets
routed out the loopback interface but not destined to the loopback interface are dropped. Under these two conditions, the
loopback interface can behave like a null interface.