Mac 防火牆設定 pf 功能

啟動內建防火牆,不是應用防火牆…

sudo pfctl -e

加入有關 SSH 規則

sudo vi /etc/pf.conf
# Restrict SSH (port 22) access
block return in proto tcp from any to any port 22
pass in inet proto tcp from 59.124.115.0/24 to any port 22 no state

載入規則

sudo pfctl -f /etc/pf.conf

參考

pf