I am having issues connecting remotely (i.e using my static IP address) to my Raspberry Pi's SSH and HTTP (nginx) servers. Al though it seems to be having trouble with any outbound traffic.
My PC and Raspberry Pi are both behind the same router, and I can connect to my RasPi from the PC using its local IP (192.168.1.81) through both SSH and HTTP. The problem starts when I try to connect to the RasPi using my remote IP. Neither HTTP nor SSH works.
If I try to connect using SSH, it connects forever (I don't even get a time-out). Running the
ssh -vvv email@example.com command generates the following output: (obviously not my real IP)
atomen@Ubuntu-PC:~$ ssh -vvv firstname.lastname@example.org OpenSSH_6.2p2 Ubuntu-6ubuntu0.1, OpenSSL 1.0.1e 11 Feb 2013 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to 255.255.255.255 port 22. debug1: Connection established. debug3: Incorrect RSA1 identifier debug3: Could not load "/home/atomen/.ssh/id_rsa" as a RSA1 public key debug1: identity file /home/atomen/.ssh/id_rsa type 1 debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048 debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048 debug1: identity file /home/atomen/.ssh/id_rsa-cert type -1 debug1: identity file /home/atomen/.ssh/id_dsa type -1 debug1: identity file /home/atomen/.ssh/id_dsa-cert type -1 debug1: identity file /home/atomen/.ssh/id_ecdsa type -1 debug1: identity file /home/atomen/.ssh/id_ecdsa-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.2p2 Ubuntu-6ubuntu0.1
... and the following entry is added to the auth.log (on the RasPi) when I cancel the connection attempt from my PC (otherwise SSH just runs forever, no more output/response except the one pasted above).
Feb 7 12:22:00 raspberrypi sshd: Connection closed by 192.168.1.254 [preauth]
Where 192.168.1.254 is the IP-address of my default route and primary DNS.
If I browse to 255.255.255.255, chrome tries to connect for ~10m until it aborts saying
The server took too long to respond (again: not my real IP). The following is the output in access.log:
192.168.1.254 - - [07/Feb/2014:12:36:04 +0000] "GET / HTTP/1.1" 200 126 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36" 192.168.1.92 - - [07/Feb/2014:12:38:15 +0000] "GET / HTTP/1.1" 200 126 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
The first line is when I connect using the remote IP (browser loads forever), and the second one using the local IP (192.168.1.81) - which gives a response in milliseconds.
When I check port 80 and 22 online both are open. But not only that; when I start my Apache server on my PC, and configure the NAT settings on the router to forward the PCs IP instead (192.168.1.92) I can successfully connect through both SSH and HTTP using my remote IP.
TL;DR I can successfully connect to my Ubuntu-PCs Apache and SSH server using my remote/static IP, but neither works when using the Raspberry PI.
NOTE: The PC is connected through WiFi, whilst the RasPi uses an Ethernet-cable.