天天看點

linux /etc/sysctl.conf 禁止别人ping自己

vi /etc/sysctl.conf

如果希望屏蔽别人 ping 你的主機,則加入以下代碼:

# Disable ping requests

net.ipv4.icmp_echo_ignore_all = 1

編輯完成後,請執行以下指令使變動立即生效:

/sbin/sysctl -p

/sbin/sysctl -w net.ipv4.route.flush=1