Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'am using Centos 6.5 with latest updates.

My problem is that whenever i try to connect to some local service it just hangs for example:

wget

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

and it hangs out to timeout.

Same with telnet, and same with connecting to irc server. External connections are running fine...

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

I arleady flush out iptables, without luck. Output form 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         

Loopback config

# 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

Turning of SELinux didn't improve it with anything.

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

# 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

works ok

# 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

The weirdest thing about it is that, i can connect to ssh, nginx server from external address (for ex. computer from which i ssh'ing) without problems.

This happens after ISP has rebooted my server. Thing that maybe useful is that, server was frequently updated without reboots.

share|improve this question
    
oh, By the way , loop back configuration is set? , test with ip a or ifconfig. –  Mohsen Pahlevanzadeh Mar 11 at 9:59
    
Yup is set, pastebin.centos.org/8351 or I badly read output. –  badray Mar 11 at 10:16
    
@badray, you have change ip configuration last time using ifconfig and the changes has not been saved, what gives a tracert 127.0.0.1 ? –  Kiwy Mar 11 at 10:44
    
@badray please edit your question instead of copying things in past bin, it's ok to have a miles long quesiton if the information is important. and yes you"re right traceroute not tracert. What ping 127.0.0.1 gives you ? –  Kiwy Mar 11 at 11:20
    
@Kiwy Ok, done as you requested. Copied whole outputs to question. Ping works great. Just added it to question. –  badray Mar 11 at 11:25
show 2 more comments

1 Answer 1

According to the ifconfig output you've posted, you have the loopback address 127.0.0.1 set on two interfaces.

Try

ip addr del 127.0.0.1/32 dev venet0

and see if your loopback access is restored.

share|improve this answer
    
Now it look likes: pastebin.centos.org/8356. Connections does not work either. –  badray Mar 11 at 10:27
1  
Please add the contents of your routing table (netstat -rn). –  Flup Mar 11 at 10:28
    
Here you are: pastebin.centos.org/8361 –  badray Mar 11 at 10:29
    
@Kiwy i added always pastebin links with outputs, becouse i'am better developer than sysadmin, and I'm not always sure that i properly read the output. EDIT: after reasearch netstat -rn shouldnt print localhost route. ip route show table local should, and it does, so this is not the case. –  badray Mar 11 at 10:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.