What do you do if your router has only a single Ethernet
interface? Or worse, what if one of your lab routers has only a Token Ring LAN
interface and you don’t have a Multistation Access Unit (MAU) unit to plug it in
to, so the interface won’t come up? Short of getting another device, the only
solution is to create loopback interface(s). What are loopback interfaces?
-
They are logical interfaces, in that they don’t connect to
any cables and, therefore, they have no hosts. Loopback interfaces are logical
interface only.
-
They are “up” by default and remain up unless
administratively shut down with the shutdown command.
-
They can be configured as a host, a subnet, a network, or a
supernet, like any other interface.
-
They can be included in the routing updates like any other
interface.
-
They can be used as a ping, a Telnet destination, or a
source.
-
Some routing protocols, such as OSPF and BGP, use loopbacks
as router IDs.
Configuring a loopback interface is similar to creating a
subinterface. The syntax is
router(config)#interface loopback num
router(config-if)#ip address ip-address subnet-mask
The num is any whole number between 0 and
2147483647. It won’t accept module-type notation, like 0/1.
Note, the no shutdown command isn’t required and
would only be used with loopback interfaces following a shutdown command.
Here is an example:
router(config)#interface loopback 0
router(config-if)#ip address 192.168.3.1 255.255.255.255
The Layer 3 addresses can be either an IP or an IPX interface
configuration (AppleTalk isn’t supported on all router platforms). The example
is a 32-bit mask, called a host mask, because it specifies a single host, not a network or a
subnetwork. Some routing protocols, such as Open Shortest Path First (OSPF), use
loopback interfaces as router IDs and prefer the host mask to avoid problems.
With protocols such as RIP, IGRP, and EIGRP, you can use any mask that serves
your purpose.