I have a WLAN with my laptop (kubuntu), a raspi (rasbmc) and a fritzbox 3370 as gateway. I can stablish a ssh connection from my laptop to the raspi when I use the local IP (192.168.X.Y). But if I try to connect over the internet I get "Conection time out". The weird thing is that I can establish a ssh connection to my laptop over the internet (with adjusted port forwarding) with my smartphone. Same happens with http on port 80.

My Setup:

  • WLAN: laptop, raspi, fritzbox3370
  • Dyndns: provider noip.com, client installed in raspi, it's working
  • Port forwarding at fritzbox: from port 30000 to raspi on port 22
  • Firewall of raspi is disabled

Overview of ssh connections:

  • laptop to raspi over WLAN (not leaving my local network) works
  • smartphone to laptop over Internet works (independant if smartphone is in
  • wlan or using mobile network)
  • laptop to raspi over internet does not work (using dyndns ip)


migrated from serverfault.com Dec 29 '14 at 13:06

This question came from our site for system and network administrators.

  • Did you port forward the raspi? – Logern Dec 29 '14 at 13:18

Your Rasbmc is a hardened version of the OS, you will need to modify your iptables to allow for traffic outside your subnet to connect to port 22. There are a few ways to do this but a simple 'iptables -A INPUT -p tcp --dport 22 -j ACCEPT' above the 'iptables -A INPUT -i $IFACE -j DROP' line located in the /etc/network/if-up.d/secure-rmc should work.

  • After changing /etc/network/if-up.d/secure-rmc I had to restart raspi. Then it worked, thanks! But it's weired, because actually I disabled firewall via rasbmc gui. – Helmosch Dec 29 '14 at 13:56

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.