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 linux server behind NAT but i can farward the port to LAN computer.

How can do that so that at least i can ssh

share|improve this question
up vote 2 down vote accepted

The standard port for ssh is 22.

You have to tell your router to forward a port (22, tcp) to your linux machine's IP. This is usually in a section called 'NAT' or 'Servers' in your router's configuration.

Most OSs have a firewall installed as standard. So you may have to open port 22 on your server machine's software firewall as well. (try 'ipkungfu' for a fairly simple interface to set up a linux firewall)

share|improve this answer
Don't forget the part about setting your server to a static IP internally. Otherwise you'll risk eventually having the machine "disappear" after coming back up from a power outage. – Bart Silverstrim Apr 30 '10 at 11:22
A static IP outside the DHCP pool, that is. – Bart Silverstrim Apr 30 '10 at 11:22

You have to use DNAT.

share|improve this answer

On the device which is doing the NAT you need to setup port forwarding.

This will forward incoming traffic on the chosen port to a particular server behind the NAT device.

How you set this up will depend on what device it is.

share|improve this answer

Reverse SSH if you dont have access to the router

share|improve this answer

Your Answer


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