LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Strange Ping Issue - Can't ping localhost but can ping others on LAN (http://www.linuxquestions.org/questions/linux-networking-3/strange-ping-issue-cant-ping-localhost-but-can-ping-others-on-lan-93001/)

code_slinger 09-15-2003 10:37 AM

Strange Ping Issue - Can't ping localhost but can ping others on LAN
 
Greetings and thanks in advance for any help. Last night, I installed Mandrake 9.1 and am having a strange issue. I set the linux machine to get its IP address from my router's DHCP server. I set the router up so that it always hands the same IP address to the linux machine. Now the linux machine gets the IP address from the router and I can browse the internet and ping any of the windows machines that I have on the network using their IP address. Having setup Apache and proftpd, I can go to a windows box and http or ftp to the linux machine, but I can't ping it. From the linux machine, I can verify that it has the IP number that I wanted it to get from the DHCP server, I can browse the internet and ping the other boxes, but I can't get a response from pinging localhost, 127.0.0.1, or the IP that I know its using from the DHCP server. Any suggestions or pointers?

Thanks,
Dave

Eqwatz 09-15-2003 11:46 AM

First) Are you using the router for the default_gateway for every computer on the private network (called a sub-net)?
No matter what, every machine has to have a default_gateway set up on it. Either the router or an address for the linux box.

Second) Is every machine on your subnet assigned a unique name? Including the linux box!
I think the windows login defaults to the owner's name, you need to set the computer's network identification (name) in a "network properties" window.

Third) Did you set-up a local domain name in the router for the subnet? And set all of the machines to be a part of it?

Fourth) You need to check the "Hosts" file in each machine. Tcp-ip defaults to checking that first. And/or respective ipconfig commands on each box.

[Once an IP address is assigned to <unique_name_for_each_host/computer> I don't think you can ping "localhost local_domain" from the outside. It is reserved for internal communication. You may be able to ping it from the same_host--then it is using the loop-back.]

Hope that gave you ideas on where to look. (I know. The post was still too long.)

steely 09-15-2003 06:42 PM

Do you have a firewall running?

code_slinger 09-16-2003 10:33 AM

Only firewall running on the network is the one on the router/cable modem. Thanks again for any ideas/suggestions. I'm going to work on it again tonite since I've been studying for the first round of exams this semester.

Moltag 09-16-2003 11:08 PM

It sounds to me like Mandrake uses some iptables rulesets right out of the box, as Red Hat does, giving your box a limited firewall. You could try flushing iptables' rule chains and see if that fixes your problem. Open a terminal, type...

iptables -F INPUT

...and then try pinging your linux box from your other hosts and via localhost. I don't know why, but it's possible 'Drake's default rulesets are blocking your ICMP packets and nothing else. It sounds silly, yes, but we've pretty much ruled out plain ol' connectivity failure, since your box was able to communicate via HTTP and FTP.

Anyway, if the above command fixes the problem, then be sure to read up on the 'Drake documentation to figure out how to turn the thing off for good.

code_slinger 09-17-2003 09:55 AM

The router on the network is also a dhcp server, and yes every other computer on the network pipes through it as a gateway to the internet. Every computer on the network has a unique name, including the linux box. I did setup a local domain name on the router, which all computers are using. I know this isn't a problem with the host files on the other computers, since I'm trying to ping using the IP address that I know the linux machine is using rather than the name of that computer. Also can't ping localhost from the linux computer. Tried the "iptables -F INPUT" command then pinging, but got the same non-response. Any more suggestions?

Thanks again,
dave

voltron1011 09-17-2003 02:05 PM

Is your loop-back interface up? I read somewhere that many times linux has this disabled because most 'users' don't use it. check /etc/sysconfig/network-scripts/ and see if you can see the lo interface...

code_slinger 09-17-2003 03:29 PM

I'm not at home at the moment so I can't check the /network-scripts/, but I do remember seeing lo listed under the ethernet interfaces list somewhere in the gui along with eth0 while working on my setup. So I'm pretty sure its there.

code_slinger 09-17-2003 08:56 PM

I checked and lo is in there. I tried 'ifconfig lo' and it shows it as having a huge amount of errors. :( Investigating further...

code_slinger 09-19-2003 12:08 AM

Woot! Figured it out finally. The problem was in /etc/sysctl.conf

I changed the line that read:
net.ipv4.icmp_echo_ignore_all=1
to:
net.ipv4.icmp_echo_ignore_all=0

and it now lets me ping localhost from the linux box and to ping the known ip from the windows box. :)

LGMike 09-20-2003 02:12 PM

unless you're troubleshooting something, you typically want that setting on! it helps to make your computer more "stealthy" (better security) ;-) --not being able to ping your computer is really not that big a deal unless you're having other connection problems. it's main purpose is to test network layers physical through networking, so it's really just a troubleshooting tool

code_slinger 09-20-2003 08:02 PM

good point. Not too worried now that I know its not a network problem. :) One of the reasons I like using linux is because its like a puzzle, rather than a point and click thing. I have the linux box setup on my network without any mouse, keyboard, or monitor. Just a network cable and a power cord. Now I'm having fun trying to figure out how to make my users accounts have there own http://ipaddress.whatever/~user/ pages work with apache's UserDir directive. Have it mostly figured out but msec keeps rewriting my permissions for the /home/user/public_html path. I'll play with it somemore then post to a thread for help. heheh. Also trying to figure out a good way to startx from a ssh connection....fun fun fun. :)

LGMike 09-21-2003 02:31 AM

yup! thats Linux!
it's always kinda cool trying to figure things out on your own, but you can use up many many hrs messing around on Linux! :D
Good luck in your many Linuxian endeavors!!!

s.ali 03-17-2011 03:47 AM

hostname not pinging in REDHAT
 
Hi,
Prob.:-hostname was not pinging in REDHAT 5.5
sol.:-I just change the hostname in system> administrator> Network>DNS>hostname.
I found hostname is localhost.
After that i am able to ping localhost.

Thanks


All times are GMT -5. The time now is 12:03 AM.