Super User is a question and answer site for computer enthusiasts and power users. 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 need to forward all connection to any address port 22 to a different gateway (i.e. no default). Firstly I suppose to do it with ipfw:

sudo ipfw add 5 fwd $EXTERNAL_IP,22 tcp from any to any 22 keep-state

But with Mac OS X Lion it seems do not work. Anyway, looking at ipfw documentation I see it is deprecated and I should use pfctl.

So I have modified /etc/pf.conf file:

rdr proto tcp from $internal_ip to any port 22 -> $external_ip port 22

But with no luck.

Does anyone know how to translate or forward all connections generated by local applications to any address but port 22 to a different gateway/ip address?

share|improve this question

You must log in to answer this question.

Browse other questions tagged .