无法通过 127.0.0.1 连接到任何服务

无法通过 127.0.0.1 连接到任何服务

我登录了一个我们几个月没碰过的 16.04 服务器,执行了操作apt-get upgrade并重新启动了它。

现在无法通过 到达任何地点127.0.0.1,例如

$ telnet 127.0.0.1 3308
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

但是 localhost 可以工作,例如

$ telnet localhost 3308
Trying ::1...
Connected to localhost.
Escape character is '^]'.
_
$B9+/&0X???gbJ:< hDWfM5mysql_native_password

因此 IPv6 可以工作,但 IPv4 显然不行。问题是我有一堆服务尝试通过 IPv4 连接。

更多信息:

不,这和16.04升级问题不一样,网络访问不是问题。

ifconfig:

eth0      Link encap:Ethernet  HWaddr f2:3c:91:e2:e9:e3  
          inet addr:139.*.*.*  Bcast:139.*.*.*  Mask:255.255.255.0
          inet6 addr: fe80::*:*:*:*/64 Scope:Link
          inet6 addr: 2a01:*::*:*:*:*/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:420333 errors:0 dropped:0 overruns:0 frame:0
          TX packets:427976 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:103142955 (103.1 MB)  TX bytes:41541069 (41.5 MB)

eth0:1    Link encap:Ethernet  HWaddr f2:3c:91:e2:e9:e3  
          inet addr:192.168.*.*  Bcast:0.0.0.0  Mask:255.255.128.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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:65536  Metric:1
          RX packets:46250 errors:0 dropped:0 overruns:0 frame:0
          TX packets:46250 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:48447261 (48.4 MB)  TX bytes:48447261 (48.4 MB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.5.4.1  P-t-P:10.5.4.1  Mask:255.255.248.0
          inet6 addr: fe80::fbaa:a6ee:9adf:f417/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:7859 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5347 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:489368 (489.3 KB)  TX bytes:1483636 (1.4 MB)

在 /etc/hosts 中:

127.0.0.1   localhost
127.0.1.1   hostname.my.domain  hostname
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

相关内容