玩蛇网提供最新Python编程技术信息以及Python资源下载!

Linux系统下如何禁ping

玩蛇网推荐图文教程:python 列表

Linux系统下如何禁ping,首先要修改配置文件对系统临时生效,系统重启后设置不起作用:

[root@208 ~]# echo  "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all

永久生效,修改系统的配置文件,如下:
[root@208 ~]# vim /etc/sysctl.conf
net.ipv4.icmp_echo_ignore_all = 1          --添加这一行
[root@208 ~]# sysctl  -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
net.ipv4.icmp_echo_ignore_all = 1
net.ipv4.conf.all.arp_notify = 1

Linux系统下如何禁ping,如果生效时有错误,错误处理
[root@208 ~]# sysctl  -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key    --错误信息
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
net.ipv4.icmp_echo_ignore_all = 1
net.ipv4.conf.all.arp_notify = 1

解决方法:
[root@208 ~]# modprobe bridge
[root@208 ~]# lsmod | grep bridge
bridge                83177  0
stp                    2218  1 bridge
llc                    5546  2 bridge,stp

玩蛇网文章,转载请注明出处和文章网址:https://www.iplaypy.com/linux/l6940.html

相关文章 Recommend

玩蛇网Python互助QQ群,欢迎加入-->: 106381465 玩蛇网Python新手群
出炉日期:2017-01-12 13:59 玩蛇网 www.iplaypy.com

您现在的位置: 玩蛇网首页 > linux入门教程 > 正文内容
我要分享到:

必知PYTHON教程 Must Know PYTHON Tutorials

必知PYTHON模块 Must Know PYTHON Modules