Strange Ping Issue - Can't ping localhost but can ping others on LAN
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Distribution: Slack Puppy Debian DSL--at the moment.
Posts: 341
Rep:
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.)
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.
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.
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?
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...
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.
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
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.
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!
Good luck in your many Linuxian endeavors!!!
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.
I know question about SSH and startx goes back to almost 12-13 years ago; but still there maybe people ending up reading it here (like myself) and want to know the answer right away
so the parameter to be passed to command ssh is -Y and below is an example :
Code:
ssh -Y oracle@db-rh65-qa.example.net
I used it with X-Windows myself so am not quite sure if/how it'd work elsewhere.
Cheers,
Sam
Last edited by Sam_Sheriff; 03-29-2015 at 10:14 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.