Loopbacks – Part 1

Let’s say that we have a router with several interfaces, as shown in Figure 1:

Now, imagine that we want to manage our router remotely via Telnet, SSH, SMTP, SDM or some other IP utility. To accomplish this, we’ll have to supply one of our router’s IP addresses to the management software. Let’s say that we choose, the address of Serial1/0. Assuming that the interface is “up/up” and running the routing protocol so that our management host can find it, we should be fine … but what if it’s not? In that case, we’d need to specify another one of our router’s addresses for management purposes.

Okay … but suppose that this router has twenty interfaces (each with an IP address), and we have hundreds (or thousands) of routers? That’s a lot of IP addresses to keep track of. We’d have to carry around a book (or a netbook!) listing which routers had which IP addresses, and for each router try its various addresses until we found one that worked. The bottom line is that managing large numbers of routers using the addresses on the physical interfaces or subinterfaces is not scalable.

Instead, let’s create a virtual interface (called a “loopback”), give it an IP address, and configure the router to advertise that address. Assuming that the loopback’s address is reachable via at least one physical path, we should be able to successfully connect to the router and manage it remotely. With Cisco IOS, we create a loopback interface and assign it an IP address like this:

Router#configure terminal

Router(config)#interface loopback 0

Router(config-if)#ip address

Note that the mask in use on the loopback interface is a “/32” (making the loopback’s address a host route). This is commonly done with management loopbacks to conserve IP address space so that we’re not tying up a large subnet (or an entire classful network) for one loopback address. Our router now appears as shown in Figure 2:

Note that the loopback interface does not physically exist (it’s a software emulation of an interface, similar to a VLAN interface on an Ethernet switch), and it appears as a “C” (connected) route in the router’s IP routing table. At this point the loopback would be reachable by the router itself, but perhaps not from other routers. We’ll deal with this issue in the next installment.

In this article

Join the Conversation