This question seems to come up a lot, but none of the answers seem to work for me. I'm trying to connect to my RPi over the internet, but when I try to connect over the internet (with putty) using a dynamic dns it get a Network error: Connection timed out.

I've done the following steps:

  1. I assigned a static IP to my RPi. I tested this with a reboot of both my router and my pi and checked with ifconfig each time. I can SSH through my LAN just fine so the issue is definitely not here.

  2. I created a hostname on no-ip and setup a script to update the hostname when it changes. The hostname's IP corresponds with my router's IP. I'm not sure if the auto-update works but that's another issue.

  3. I setup a port forward from my router (source port 22322) to my RPi's static IP (destination port 22). I used http://canyouseeme.org/ to confirm if the port's open and it says it's successfull.

  4. I added a rule to iptables to allow the traffic, iptables -L returns the following:

    root@foxypi:/home/pi# iptables -L
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
  5. In /etc/sysctl.conf I uncommented the line net.ipv4.ip_forward=1

From what I've read this should allow me to SSH into my RPi, but it just won't work and I'm stumped. Did I miss a crucial step?

  • Steps 4 and 5 are not required Nov 8, 2015 at 21:38

1 Answer 1


Apparently I made an incredibly simple oversight. Turns out my router doesn't support NAT loopback so when I tried to connect over internet while I'm on the LAN network it didn't work. I just tried again from a public wifi and it works without a hitch.

For those who have the same issue, try connecting from a machine that's not connected on the same LAN as the RPi.

  • You could still connect on your home network using the Pi's internal/private IP. Nov 9, 2015 at 0:29
  • Oh yea, I could connect using my local IP just fine on my LAN. It's just that I didn't think of testing my internet connection outside of my LAN.
    – ricekab
    Nov 9, 2015 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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