我正在使用具有最新更新的Centos 6.5。
我的问题是,每当我尝试连接到某些本地服务时,它都将挂起,例如:
get
wget 127.0.0.1
--2014-03-11 12:43:42-- http://127.0.0.1/
Connecting to 127.0.0.1:80...
After a while timeout...
ssh
# ssh 127.0.0.1 -p 6060 -v
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 6060.
debug1: connect to address 127.0.0.1 port 6060: Connection timed out
ssh: connect to host 127.0.0.1 port 6060: Connection timed out
并且挂断超时。
与telnet相同,与连接到irc服务器相同。外部连接运行良好...
netstat -tpln
# netstat -tpln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 589/sendmail
tcp 0 0 127.0.0.1:6060 0.0.0.0:* LISTEN 520/sshd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 619/nginx
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 478/sshd
tcp 0 0 ::1:6060 :::* LISTEN 520/sshd
tcp 0 0 :::22 :::* LISTEN 478/sshd
netstat -rn
# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 venet0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 venet0
iptables
我无情地冲出iptables。输出表格iptables:
# iptables -nvL
Chain INPUT (policy ACCEPT 634 packets, 49819 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 517 packets, 47027 bytes)
pkts bytes target prot opt in out source destination
回送配置
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/void
inet 127.0.0.1/32 scope host venet0
inet 176.122.224.115/32 brd 176.122.224.115 scope global venet0:0
转向SELinux并没有任何改善。
ip route show table local
# ip route show table local
local 176.122.224.115 dev venet0 proto kernel scope host src 176.122.224.115
broadcast 176.122.224.115 dev venet0 proto kernel scope link src 176.122.224.115
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1
broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1
跟踪路由
# traceroute 127.0.0.1
traceroute to 127.0.0.1 (127.0.0.1), 30 hops max, 60 byte packets
1 localhost.localdomain (127.0.0.1) 0.029 ms 0.014 ms 0.012 ms
ping 127.0.0.1
可以
# 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.024 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.036 ms
关于它的最奇怪的事情是,我可以从外部地址连接到ssh,nginx服务器(例如我从ssh所使用的前一台计算机)而不会出现问题。
ISP重新启动服务器后,就会发生这种情况。可能有用的是,服务器经常更新而无需重新启动。
是的,设置为pastebin.centos.org/8351还是我读取输出错误。
—
badray 2014年
@badray,您上次使用ifconfig更改了IP配置,但尚未保存更改,是什么导致了tracert 127.0.0.1?
—
2014年
@Kiwy好,按您的要求完成。复制了整个输出以供质疑。Ping的效果很好。刚刚将其添加到问题。
—
badray 2014年
ip a
或进行测试ifconfig
。