LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   localhost (https://www.linuxquestions.org/questions/linux-networking-3/localhost-125376/)

boemitsu 12-12-2003 08:31 PM

localhost
 
hello

I've really got a very strange problem with localhost, and I don't have any idea how to fix it...hope you guys can give me a hint.

I'm running slackware 9.1 on a linuxbox acting as a router/webserver.

my problem is, that I can access the webserver from the internet/intranet, but not from localhost.

the same problem is with ping, I get response from google.com
--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 107.544/108.098/108.652/0.554 ms

but when I try ping localhost (or 127.0.0.1 or entries in /etc/hosts), I only get
PING localhost (127.0.0.1) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted

--- localhost ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1016ms

the output from route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
80.219.32.0 * 255.255.240.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 80-219-32-1.dcl 0.0.0.0 UG 0 0 0 eth0

the output from iptables -L -v (
of course this is for testing purposes....)
Chain INPUT (policy ACCEPT 2917 packets, 1330K 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 2269 packets, 284K bytes)
pkts bytes target prot opt in out source destination


and finally from ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:C0:26:8E:23:15
inet addr:80.219.41.xxx Bcast:255.255.255.255 Mask:255.255.240.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:44501398 errors:0 dropped:0 overruns:0 frame:0
TX packets:11966 errors:0 dropped:0 overruns:0 carrier:0
collisions:17 txqueuelen:100
RX bytes:2690286557 (2565.6 Mb) TX bytes:1668027 (1.5 Mb)
Interrupt:10 Base address:0xecc0

eth1 Link encap:Ethernet HWaddr 00:00:F8:79:A7:4E
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:55 errors:3 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:11320 (11.0 Kb) TX bytes:0 (0.0 b)
Interrupt:9 Base address:0xec00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 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)



lo is up, a routing table entry is availible, there is no iptables rule blocking anything at all....??

:confused: :confused:

PLEASE HELP :cry:

thx !

boemitsu 12-13-2003 06:17 AM

does nobody have a little hint...? slackware users...?

ugob 12-13-2003 08:07 AM

It looks like a firewalling trouble. Have you tried stopping iptables completely and then retrying?

/etc/init.d/iptables stop
in redhat, don't know for suse

david_ross 12-13-2003 08:42 AM

It doesn't look like a firewall problem since all teh chains are set to ACCEPT.

Check that you have a localhost entry next to the loopback address in /etc/hosts. Can you ping the loopback address directly:
ping -c 3 127.0.0.1

ugob 12-13-2003 08:51 AM

Yes, he said he tried with the ip add.

Can you ping it from another machine? or access a service like sendmail or ssh?

boemitsu 12-13-2003 11:18 AM

thx guys for taking time to help me with this prob !

@ugob
I can establish a ssh connection to my box, ping is also possible from intranet and internet....

the output of /etc/hosts

# For loopbacking.
127.0.0.1 localhost

# End of hosts.


I also tried to add a entry like

127.0.0.1 m3

but without success.

if u need further information, please let me know that, and I will post it as soon as possible.

many thanks

boemitsu 12-13-2003 02:41 PM

?
 
.

ugob 12-13-2003 04:11 PM

Re: ?
 
Quote:

Originally posted by boemitsu
anybody out there ??
Wait a minute, man, I don't stay in front of my computer just in case you need help...

With what user do you ping, locally, have you tried it with root? It may be a permission on the executable itself.

http://info.ccone.at/INFO/Mail-Archi.../msg00039.html

chort 12-13-2003 05:01 PM

Are you sure your webserver is even bound to a loopback IP? If Apache is only bound to your public IP, then you would need to connect to it with that IP. If you don't have a nameserver configured in /etc/resolv.conf and the only thing in /etc/hosts in 127.0.0.1, then you have no way of reaching your web server by name.

Oh, so any way the point is to do a
$ netstat -anA inet
and paste the output.

boemitsu 12-13-2003 06:42 PM

@ugob
I did't want to put you under stress....sorry if you feel so.

root@m3:~# netstat -anA inet
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:37 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:79 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 80.219.41.x:22 80.219.30.x:1208 ESTABLISHED
udp 0 0 0.0.0.0:512 0.0.0.0:*
udp 0 0 0.0.0.0:518 0.0.0.0:*
udp 0 0 0.0.0.0:37 0.0.0.0:*
udp 0 0 0.0.0.0:67 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*
raw 0 0 0.0.0.0:1 0.0.0.0:* 7


root@m3:~# cat /etc/resolv.conf
nameserver 62.2.17.61
nameserver 62.2.24.158
nameserver 62.2.17.60
nameserver 62.2.24.162
root@m3:~#

ugob 12-13-2003 09:22 PM

chort: I don't see what this has to do with the apache web server, we're only trying to ping the localhost...

boemitsu: I didn't feel stressed but your question will not be answered more rapidly if you do that... could have an adverse effect, in fact.

Did you check what I suggested? Looked at the link?

Have you only searched a bit on google on your problem?

chort 12-13-2003 10:29 PM

Doesn't have anything to do with pinging localhost, but the fact that he can't ping lo0 might be entirely unrelated to not being able to view the website from that machine, which was the whole point of the question in the first place.

However, we established that: Yes, Apache is bound to 127.0.0.1 as well as the Internet IP.

ugob 12-13-2003 10:32 PM

Sorry, I didn't remember that he said "able to see website from intranet but not from localhost.

Pretty weird problem.

DavidPhillips 12-14-2003 12:30 AM

It might be in /etc/nsswitch.conf or not as likely in /etc/host.conf

What's in those files?


Maybe run ldconfig just for giggles

DavidPhillips 12-14-2003 12:34 AM

What have you updated or installed lately?


All times are GMT -5. The time now is 05:28 AM.