小编naf*_*afe的帖子

iptables 等价于 mac os x

我想转发来自192.168.99.100:80to 的请求127.0.0.1:8000。这就是我在 linux 中使用的方法iptables

iptables -t nat -A OUTPUT -p tcp --dport 80 -d 192.168.99.100 -j DNAT --to-destination 127.0.0.1:8000
Run Code Online (Sandbox Code Playgroud)

我如何在 MacOS X 中做同样的事情?我尝试了一些ipfw命令组合,但没有取得多大成功:

ipfw add fwd 127.0.0.1,8000 tcp from any to 192.168.99.100 80
Run Code Online (Sandbox Code Playgroud)

(对我来说,成功是指向浏览器http://192.168.99.100并从我运行的开发服务器获得响应localhost:8000

iptables mac-osx ipfw

68
推荐指数
3
解决办法
18万
查看次数

标签 统计

ipfw ×1

iptables ×1

mac-osx ×1