跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • How to deny ICMP ping requests
未分類
15 2 月 2022

How to deny ICMP ping requests

xiaomifan 大佬有话说 :

How to deny ICMP ping requests

Instructions
Update UFW rules
In order to deny any incoming ICMP ping requests we need to modify /etc/ufw/before.rules UFW’s configuration file. First, make a backup copy:

$ sudo cp /etc/ufw/before.rules /etc/ufw/before.rules_backup
Next, open the file with root privileges using your favorite text editor and change:

FROM:

# ok icmp codes for INPUT
-A ufw-before-input -p icmp –icmp-type destination-unreachable -j ACCEPT
-A ufw-before-input -p icmp –icmp-type source-quench -j ACCEPT
-A ufw-before-input -p icmp –icmp-type time-exceeded -j ACCEPT
-A ufw-before-input -p icmp –icmp-type parameter-problem -j ACCEPT
-A ufw-before-input -p icmp –icmp-type echo-request -j ACCEPT
TO:

# ok icmp codes for INPUT
-A ufw-before-input -p icmp –icmp-type destination-unreachable -j DROP
-A ufw-before-input -p icmp –icmp-type source-quench -j DROP
-A ufw-before-input -p icmp –icmp-type time-exceeded -j DROP
-A ufw-before-input -p icmp –icmp-type parameter-problem -j DROP
-A ufw-before-input -p icmp –icmp-type echo-request -j DROP

Alternatively, use the below sed command to perform the change:

$ sudo sed -i ‘/ufw-before-input.*icmp/s/ACCEPT/DROP/g’ /etc/ufw/before.rules
Enable Firewall
Enable UFW firewall using the following linux command:

$ sudo ufw enable
Alternatively, if your firewall is already enabled you can reload it with:

$ sudo ufw reload

hcyme 大佬有话说 :

不方便,自己都看不到

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具