1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
What you see in this example is evidence that the loopback interface is
present and active. The inet listed is the IP number assigned to the
localhost, typically 127.0.0.1, along with the broadcast mask 255.0.0.0.
You can also see the IPv6 address that is assigned to lo, which is ::1/128,
referred to as the inet6.
NOTE
Previously you checked for the availability of the loopback interface by
using the now-deprecated ifconfig, like so:
Click here to view code image
matthew@seymour:~$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:270 errors:0 dropped:0 overruns:0 frame:0
TX packets:270 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20748 (20.7 KB) TX bytes:20748 (20.7 KB)
ifconfig still works but is slowly disappearing and is no longer installed
by default. If you learned ifconfig, we strongly recommend spending
the time to learn ip and use it instead.
Configuring the Loopback Interface Manually
The localhost interface’s IP address is specified in a text configuration
file that is used by Ubuntu to keep records of various network-wide IP
addresses. The file is called /etc /hosts and usually exists on a system,
even if it is empty. The Linux kernel and other networking tools use this file
to access local IP addresses and hostnames. If you have not configured any
other networking interfaces, you might find that the file looks something like
this:
Click here to view code image
127.0.0.1 localhost