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 am trying to forward a remote port from my server to my development machine. I have tried opening the port via iptables, but it is open only for

If I login to the server using ssh and try curl http: PORT, the request is redirected to my local development machine. But the port is inaccessible to outside ip addresses.

Here is the output of netstat -an

tcp        0      0    *               LISTEN     
tcp        0      0    *               LISTEN     
tcp        0      0 *****               LISTEN     
tcp        0      0*               LISTEN     
tcp        0      0    *               LISTEN     
tcp        0      0     ESTABLISHED
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:8099                :::*                    LISTEN 
share|improve this question

You need to set the optional bind_address to * E.g. if you're doing a local forward originating on the server (-L) then use ssh -L '*:8099:localhost:8099' mydevbox (note the quotes to keep the shell from expanding the asterisk)

share|improve this answer
I am doing a remote port forwarding. If my dev machine is accessible from outside, then I do not need this port forwarding stuff. – Jagira Nov 25 '10 at 7:12
What are you using to do the port forward that works from localhost? – Ben Jencks Nov 25 '10 at 7:16
ssh -R 8099:localhost:3000 MY_REMOTE_SERVER – Jagira Nov 25 '10 at 7:17
Then do the equivalent for the -R option... -R *:8099:localhost:3000 Did you read the man page for the options you're using? – Ben Jencks Nov 25 '10 at 7:19
You might need to turn on GatewayPorts on the server. By default it ignores bind_address in remote forwards. – Ben Jencks Nov 25 '10 at 7:23

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.