美文网首页
CentOS 7.0关于Ping的禁止与启用

CentOS 7.0关于Ping的禁止与启用

作者: 422ccfa02512 | 来源:发表于2020-04-18 16:43 被阅读0次
禁用ICMP协议,输入:

vim /etc/sysctl.conf

添加一条信息:

net.ipv4.icmp_echo_ignore_all = 1

保存并退出,输入:

sysctl -p

使配置生效。

启用ICMP协议,输入:

vim /etc/sysctl.conf

将:

net.ipv4.icmp_echo_ignore_all = 1

修改为:

net.ipv4.icmp_echo_ignore_all = 0

如果没有

net.ipv4.icmp_echo_ignore_all = 1

就添加:

net.ipv4.icmp_echo_ignore_all = 0

保存并退出,输入:

sysctl -p

相关文章

网友评论

      本文标题:CentOS 7.0关于Ping的禁止与启用

      本文链接:https://www.haomeiwen.com/subject/ineyvhtx.html