pfctl

Mac OS 的防火墙软件在10.10已经将IPFW取消,改用OpenBSD的PF 在mac10.13.1上,发现没有iptables、ipfw、pf命令,只有pfctl命令。

Mac 打开端口供外网访问

  1. 编辑pf.conf文件
    sudo sudo vim /etc/pf.conf
    
  2. 将下面语句添加到文件末尾,xxxx为你要打开的端口
    pass in proto tcp from any to any port xxxx
    
  3. 重新加载配置文件
    sudo pfctl -vnf /etc/pf.conf
    

results matching ""

    No results matching ""