Obviously, the problem seems to be either the port forwarding configuration, or the ability for the SSH server/RPi to handle external connections.
Port forwarding configuration
Maybe you should try with a specific external port. Let's say 10022 (external port) forward to your RPi IP address, port 22. Then from an external IP address, try telnet <your IP address> 10022
. If you have a message similar to this:
$ telnet <your IP address> 10022
Trying <your IP address>...
Connected to <your IP address>.
Escape character is '^]'.
SSH-2.0-OpenSSH_6.6.1p1 Debian-7
...then, the port forwarding works well. Otherwise, you should try another server with another server, just to make sure your SSH server does not reject external connections.
iperf
I like to use iperf
to make sure my device is reachable from my external network. This software allows you to test the bandwidth performances and, maybe it is not the fastest way, but it is lightweight and easy to use :-)
Install it from your RPi (sudo apt-get install iperf
), then run iperf -s
. The default listening port is 5001. So you will have to define another port forwarding (external port 5001 -> <RPi IP address>
, port 5001). From an external IP address, run telnet <your IP address> 5001
.
$ telnet <your IP address> 5001
Trying <your IP address>...
Connected to <your IP address>.
Escape character is '^]'.
If you see a similar message, then the port forwarding configuration works well. Otherwise, you should tweak your router...
SSH server configuration
If none solution of the above worked, the problem is probably in the SSH server or RPi configuration.
netstat
We will make sure the SSH server listens for every hosts. Run sudo netstat -anp | grep ssh
. You see the 0.0.0.0
part of the following line? It says "I [the SSH server] will listen the port 22 but only for the hosts matching 0.0.0.0
" (0.0.0.0
means "every hosts"). If you don't see it, the problem is SSH server configuration (see next section):
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 21985/sshd
/etc/ssh/ssh_config
Please copy/paste the result of cat /etc/ssh/ssh_config
in the comment section.
/etc/hosts.deny
& /etc/hosts.allow
You can also have a look in the following files /etc/hosts.deny
& /etc/hosts.allow
. Please copy/paste the result of cat /etc/hosts.deny
& cat /etc/hosts.allow
in the comment section.
ping verizon.com
tell you run on the pi?