I have a ubuntu pc with openssh server installed in my home network. I can connect via SSH to it without any problems.

Being connected, every bunch of minutes this machine is not more able to ping to any host outside, even to the internal router (which one is used for NAT at the same moment). If I would not be connected remotely during expecting those problems, I would blame the network cable or firewall; but because this very connections seems to work, I have no idea where I could search for the problem.

Any hints? Thanks!

  • Collect the output of ip addr and ip route both when the connections work and when they fail. Check logs in /var/logs/ for messages that might indicate problems. – sarnold Mar 22 '12 at 1:03

The Linux kernel has a firewall built in to it called IP Tables. Chances are that your ubuntu install has the default iptables config that only allows packets back that originate from your machine, and ssh for remote administration. You can see what your current firewall rules are with the command sudo iptables -L.

A quick test would be to flush all of the rules, since the default behavior of iptables is to allow packets, with the command sudo iptables -F. To get your rules back, just restart the iptables service or reboot.

If you want to allow ping (ICMP) packets persistently, check out this tutorial: http://www.cyberciti.biz/tips/linux-iptables-9-allow-icmp-ping.html

  • Sorry, this wasn't the problem. As I said, the ping works most times but sometimes not. – Andreas Mar 21 '12 at 13:44
  • Is it after the system has been idle for a while? It could be a power saving setting. – calmond Mar 21 '12 at 15:48

It was the IP. Another machine had the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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