Skip to content

Configure FreeBSD to forbid ping (ICMP)

配置FreeBSD禁止ping

启用pf防火墙

/etc/rc.conf 中加入

firewall_enable="YES"
pf_enable="YES"
pf_rules="/usr/local/etc/pf.conf"

添加防火墙icmp规则

/usr/local/etc/pf.conf 中增加一条防火墙规则

block in on vtnet0 proto icmp all

其中,vtnet0 是外网网卡

Reference