LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-07-2002, 08:29 AM   #1
squid.mib
LQ Newbie
 
Registered: Aug 2002
Posts: 3

Rep: Reputation: 0
ping localhost failed


I can ping everything else, but when I ping localhost it takes a long time and and 100% packet loss.

squid root # ping -c 1 www.google.ch
PING www.google.com (216.239.51.101): 56 octets data
64 octets from 216.239.51.101: icmp_seq=0 ttl=42 time=336.5 ms

--- www.google.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 336.5/336.5/336.5 ms

squid root # ping -c 1 localhost
PING localhost.localdomain (127.0.0.1): 56 octets data

--- localhost.localdomain ping statistics ---
1 packets transmitted, 0 packets received, 100% packet loss

The interface lo is up:

squid root # ifconfig lo
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:11 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:924 (924.0 b) TX bytes:924 (924.0 b)

But I think I could have a problem with the routing table;

squid root # netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.168.0 * 255.255.255.0 U 40 0 0 eth0
default 192.168.168.1 0.0.0.0 UG 40 0 0 eth0

And my firewall blocks nothing.

Can anyone help me? I use gentoo Linux.

Thanks
 
Old 08-07-2002, 08:49 AM   #2
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 47
the only thing that comes to my mind is maybe that you dont have Loopback setup in /etc/hosts

You should have a line such as:
127.0.0.1 localhost
also try only
ping 127.0.0.1
instead of ping localhost and see what you get

Hope that helps
-NSKL
 
Old 08-07-2002, 08:53 AM   #3
squid.mib
LQ Newbie
 
Registered: Aug 2002
Posts: 3

Original Poster
Rep: Reputation: 0
The same thing happens when I try to ping 127.0.0.1 and I have the line in my /etc/hosts

127.0.0.1 localhost

squid root # ping -c 1 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 octets data

--- 127.0.0.1 ping statistics ---
1 packets transmitted, 0 packets received, 100% packet loss
 
Old 08-07-2002, 11:36 AM   #4
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
what distro are you using?


can you ping the box from another machine?

i had a similar problem, i could not ping the host at all but i could ping other hosts.
it turned out that a file in /proc/sys/net/ipv4 had a 1 in it and not a zero after i changed it to a zero it worked fine!
 
Old 08-08-2002, 01:32 AM   #5
squid.mib
LQ Newbie
 
Registered: Aug 2002
Posts: 3

Original Poster
Rep: Reputation: 0
I use Gentoo-Linux.

And after I changed the 1 in the file /proc/sys/net/ipv4/icmp_echo_ignore_all to a zero and now it works fine!

Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
Can't ping localhost (ping: sendto: Operation not permitted) mentor99us Linux - Networking 7 09-05-2012 02:11 PM
MDK 9.2, Can't ping localhost but can ping outside world? JohnLocke Linux - Networking 2 07-01-2004 05:59 PM
I can ping google.com successfully,but ping client(in my intranet) failed.Why? whepin Linux - Newbie 4 12-30-2001 04:54 AM
I ping servername failed,but ping ipofservername successfully,Why? whepin Linux - Networking 2 12-20-2001 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration