缺少127.0.0.1(环回地址)

时间:2015-04-01 08:40:39

标签: linux ubuntu loopback-address

Ubuntu linux,14.04(DigitalOcean)

$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 04:01:1f:4c:XX:XX  
          inet addr:128.199.XXX.XXX  Bcast:128.199.XXX.255  Mask:255.255.192.0
          inet6 addr: fe80::601:1fff:XXXX:XXX/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1565 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1603 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:228014 (228.0 KB)  TX bytes:260483 (260.4 KB)

lo        Link encap:Local Loopback  
          LOOPBACK  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

我在环回中找不到127.0.0.1。

我可以恢复127.0.0.1吗?

$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.

很久没有回应了。

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your
# system and how to activate them. For more information, see
# interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 128.199.XXX.XXX
        netmask 255.255.XXX.0
        gateway 128.199.XXX.1
        dns-nameservers 8.8.4.4 8.8.8.8 209.244.0.3

的/ etc /网络/接口。这是默认的。

1 个答案:

答案 0 :(得分:0)

谢谢,它已经解决了。

sudo apt-get update
sudo dpkg --configure -a
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot now

$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.031 ms
相关问题