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 have tried to solve this issue using pf but with no luck. Basically, I am trying to redirect incoming port 443 traffic to port 22. I have tried to set up a rule in a file and load it in pf but I get syntax error. Can anyone with more experience with pf provide some insight? Here's what I've attempted:

pass in on en1 proto tcp from any to any port 443 rdr-to port 22


pass in quick proto tcp to port 443 rdr-to port 22

I've been able to do this in MacOSX Snow Leopard with ipfw:

sudo ipfw add 1443 forward,22 ip from any to any 443 in

but it doesn't work in Lion (it gives me an Invalid Argument error).

share|improve this question
This is a guess, but is anything else running on port 443 that has a higher rule than your script? What happens if you move your rule to the top of the ipfw chain? – user3463 May 2 '12 at 17:25
thanks for your reply. when I said ipfw doesn't work in lion, I should have said that I get an "invalid argument" error without much information on what is wrong with the command. the same command though works fine in Snow Leopard. – Andreas May 3 '12 at 9:42
Check out this link, which I pointed out in another firewall question: – user3463 May 3 '12 at 15:25

I'm pretty sure you don't want to forward any to any but something like any to me,
this works fine for me in Lion

sudo ipfw add 1443 fwd,22 tcp from any to me 443 in

share|improve this answer

Since mac os X 10.7 apple uses pf instead of ipfw . It is easy to configure pf with IceFloor. Check it out:

share|improve this answer
OS X 10.8.5 still uses ipfw. – suspectus Oct 6 '15 at 7:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .