Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 127.0.0.1 port 22

and

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

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

sudo ipfw add 1443 forward 127.0.0.1,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: serverfault.com/q/102416/3914 –  user3463 May 3 '12 at 15:25
add comment

2 Answers

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 127.0.0.1,22 tcp from any to me 443 in

share|improve this answer
add comment

Since mac os X 10.7 apple uses pf instead of ipfw . It is easy to configure pf with IceFloor. Check it out: http://www.hanynet.com/icefloor/index.html

share|improve this answer
add comment

Your Answer

 
discard

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.