Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a static IP set on a Planet VRT-311S VPN router and port 22 (UDP and TCP) forwarded to an Ubuntu server on the LAN. I am still unable to connect to the Ubuntu server.

I am currently using the following command on an external computer:

ssh -p 22 <router's ip address>

I am still unable to connect to the Ubuntu server. How can I troubleshoot this?

share|improve this question
I updated your question with the latest information you've provided and also updated my answer. – Wesley Sep 3 '11 at 8:25
Updated my answer again. – Wesley Sep 3 '11 at 18:27
up vote 3 down vote accepted

The routing device that has the public IP address needs to forward port 22 traffic to the Ubuntu server that is behind the firewall. If you tell us what kind of firewall / edge device it is, we might be able to help point you in a more specific direction.

EDIT: You'll need to check that traffic is truly being sent to your Ubuntu server. Run tcpdump to see if SSH traffic is hitting your server. If it's not, you still have an edge router problem. If it is, then you can start focusing on the Ubuntu server. Once you figure that out, we might be able to help you more.

EDIT 2: If you set up port forwarding for port 22, the router handles the translation for all traffic bound for port 22 directed at the public IP address and immediately sends the traffic to the Ubuntu server. The Ubuntu server then sees the traffic coming from the router, and any responses to port 22 traffic get sent to the router which then forwards it on to you. The router handles all the traffic translation by maintaining a table of who is communicating to which port and assigning unique sessions to each communicant. That way even multiple people can talk to the Ubuntu server through ssh using the external IP address.

For example: If you have an external IP address at home of and your office router has an external IP address of and the Ubuntu server has a local IP of (behind the router), the traffic flows like this:

  • connects to
  • gets forwarded to
  • responds to the router at (well, in reality it responds to the local IP address of the router, not the public IP address. It would probably be in this example.)
  • The router then forwards the information back to your home's public IP of
share|improve this answer
I'm using a planet vrt-311 VPN router. I have forwarded the ports tcp udp 22 and I checked online the port and it is opened. – bash- Sep 3 '11 at 7:11
I have multiple computers connected to the same static ip. If I connect remotely to the same static ip like `ssh -p 22 < static ip >, how will I know or the network know I want to connect to the ubuntu server? – bash- Sep 3 '11 at 17:49

tdpdump may be an overkill here. Just do telnet <yourip> 22 from outside and telnet localhost 22 on your ubuntu server. Ssh server should respond immediately with something like 'SSH-2.0-OpenSSH_5.8p1-hpn13v10'.

If telnet from localhost does not work, you have problems with your ssh server. If telnet from localhost works, but not from outside, this is probably router-related problem. If both works, this might be your ssh client problem.

And another one guess: check your firewall rules on the server. You can print out them by running /sbin/iptables -L.

Please update your answer with results of telnet diagnostics and with list of your firewall rules, so we'll be able to give you better advice.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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