想把发送到 192.168.1.8:80 的请求转发到 192.168.1.10:8000
在/etc/pf.conf中添加了如下规则:
scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
rdr-anchor "com.apple/*"
rdr pass on lo0 inet proto tcp from any to 192.168.1.8 port 80 -> 192.168.1.10 port 8000
rdr pass on en0 inet proto tcp from any to 192.168.1.8 port 80 -> 192.168.1.10 port 8000
rdr-anchor "debookee"
dummynet-anchor "com.apple/*"
anchor "com.apple/*"
anchor "debookee"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
然后启动
sudo sysctl -w net.inet.ip.forwarding=1
sudo pfctl -ef /etc/pf.conf
但并没有转发,是我用错了吗