Mac OS X Lion 上的端口重定向

And*_*eas 6 port-forwarding ipfw osx-lion macos

我试图使用 pf 解决这个问题,但没有运气。基本上,我试图将传入端口 443 流量重定向到端口 22。我尝试在文件中设置规则并将其加载到 pf 中,但出现语法错误。任何对 pf 有更多经验的人都可以提供一些见解吗?这是我尝试过的:

pass in on en1 proto tcp from any to any port 443 rdr-to 127.0.0.1 port 22
Run Code Online (Sandbox Code Playgroud)

pass in quick proto tcp to port 443 rdr-to 127.0.0.1 port 22
Run Code Online (Sandbox Code Playgroud)

我已经能够使用 ipfw 在 MacOSX Snow Leopard 中做到这一点:

sudo ipfw add 1443 forward 127.0.0.1,22 ip from any to any 443 in
Run Code Online (Sandbox Code Playgroud)

但它在 Lion 中不起作用(它给了我一个无效参数错误)。

小智 3

我很确定你不想转发,any to any但是类似这样的东西 对我来说在 Lion 中效果很好any to me

须藤 ipfw 添加1443 fwd 127.0.0.1,22 tcp from any to me 443 in