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
https://docs.freebsd.org/zh_CN.UTF-8/books/handbook/securing-freebsd.html
Disclaimer
- License under
CC BY-NC 4.0
- Copyright issue feedback
me#imzye.me
, replace # with @ - Not all the commands and scripts are tested in production environment, use at your own risk
- No privacy information is collected here