I have two network interfaces in my CentOS 5.8 machine, one with a local IP and one with an external, publicly available, IP. I'm running SSH and some other services. I can access these if I connect to the local IP of the machine from some other machine in the same local network. But if I connect from another machine to the external, public IP of the machine, I can't get in.

Even though I disabled the IPtables firewall with service iptables stop, it won't work. Any suggestions? I have tried with SELinux disabled (setenforce 0) and also by adding ports to the setup firewall configuration. I did check with netstat and both the SSH service and other services are listening to

  • What did you get on the client when connecting via public IP? Also post the /var/log/secure on the server. – quanta Sep 20 '12 at 4:48
  • [root@xxx ~]# ssh xxx.xxx.xxx.xxx ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection timed out Nothing is added to /var/log/secure – dataviruset Sep 20 '12 at 7:24
  • netstat -nlp | grep :22? – quanta Sep 20 '12 at 7:35

Check that the router is forwarding the inbound traffic. Additionally, verify that there are no odd rules in /etc/hosts.deny.

  • Apparently there was some hardware firewall I didn't know of, so the problem wasn't in CentOS nor IPtables. Thanks for helping! – dataviruset Sep 20 '12 at 7:35

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.