mac 电脑端口转发
mac

在mac 下做端口的转发,例如本地服务是8080,但是我们用通过80端口去访问这个服务

echo "rdr pass proto tcp from any to any port {80} -> 127.0.0.1 port 8080" | sudo pfctl -Ef -

查看转发规则

sudo pfctl -s nat

No ALTQ support in kernel
ALTQ related functions disabled
rdr pass inet proto tcp from any to any port = 80 -> 127.0.0.1 port 8080

remove转发脚本

sudo pfctl -F all -f /etc/pf.conf




暂无评论