我正在使用macOS 10.12,我想做ip:端口映射
恩.127.0.0.1:32769到10.0.0.1然后我可以添加10.0.0.1 somedomain.com到我的/etc/hosts
我做了一些搜索,并在这篇文章中找到了这个问题的解决方案:
https://serverfault.com/questions/102416/iptables-equivalent-for-mac-os-x/673551#673551
但是这篇文章中的命令只适用于最新的命令.
每次我使用此命令时,系统都会回复我:
$ sudo ifconfig lo0 10.0.0.2 alias
$ echo "rdr pass on lo0 inet proto tcp from any to 10.0.0.2 port 80 -> 127.0.0.1 port 32771" | sudo pfctl -ef -
pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.
No ALTQ support in kernel
ALTQ related functions disabled
pfctl: pf already enabled
Run Code Online (Sandbox Code Playgroud)
我怎样才能防止冲洗规则?或者有什么方法可以让这项工作更轻松?
非常感谢
| 归档时间: |
|
| 查看次数: |
615 次 |
| 最近记录: |