除了macOS Sierra(redsocks)上的ssh之外的所有端口上的端口转发


1

我试图使用pfctl在OSX Sierra上转发除端口22之外的所有端口,但它似乎不起作用。

file:/pf.conf

ext_if = "inet"
rdr pass $ext_if proto tcp from any to any -> 127.0.0.1 port 12345
rdr pass $ext_if proto udp from any to any -> 127.0.0.1 port 10053
pass out proto tcp from any to any port ssh

我启用它

sudo sysctl -w net.inet.ip.forwarding=1
sudo pfctl -f pf.conf
sudo pfctl -e

流量似乎正在重定向到端口12345,但我不能让端口22直通。

Answers:


1

ssh行应该在'rdr'行之上,以便首先匹配ssh行。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.