Skip to content
Discussion options

You must be logged in to vote

可以先手动执行以下命令来禁用 ICMP 或 ICMPv6 ping 功能。如果有效,我们会在后续版本中考虑集成和适配。具体操作如下:

1. 检查和配置防火墙规则

IPv4 ICMP

  1. 查看现有规则:

    sudo iptables -L -v -n
  2. 添加规则以禁用 ICMP 回显请求:

    sudo iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
  3. 保存规则 (适用于基于 iptables 的系统):

    sudo iptables-save > /etc/iptables/rules.v4

IPv6 ICMP

  1. 查看现有规则:

    sudo ip6tables -L -v -n
  2. 添加规则以禁用 ICMPv6 回显请求:

    sudo ip6tables -A INPUT -p ipv6-icmp --icmpv6-type echo-request -j DROP
  3. 保存规则:

    sudo ip6tables-save > /etc/iptables/rules.v6

2. 调整系统设置

禁用 ICMP (IPv4)

  1. 编辑 /etc/sysctl.conf 文件:

    sudo nano /etc/sysctl.conf
  2. 添加以下行以禁用 ICMP 回显请求:

    net.ipv4.icmp_echo_ignore_all = 1
  3. 应用更改:

    sudo sysctl -p

禁用 ICMPv6 (IPv6)

  1. 编辑 /etc/sysctl.conf 文件:

    sudo nano /etc/sy…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Muione
Comment options

Answer selected by Muione
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5959 on July 28, 2024 02:04.