手机版
你好,游客 登录 注册
背景:
阅读新闻

Linux系统禁ping

[日期:2014-01-10] 来源:Linux社区  作者:tongcheng [字体:大 中 小]

1.修改配置文件对系统临时生效,系统重启后设置不起作用。
[root@208 ~]# echo  "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all

2.永久生效,修改系统的配置文件
[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

3.如果生效时有错误,错误处理
[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

推荐阅读:

Fedora 18 下arping 的安装 http://www.linuxidc.com/Linux/2013-06/85300.htm

CentOS 6.2 下安装 smokeping 测试网络状况 http://www.linuxidc.com/Linux/2012-12/75843.htm

CentOS中Iptables关于ping的配置问题 http://www.linuxidc.com/Linux/2012-11/74660.htm

VMware下Linux如何ping通Windows http://www.linuxidc.com/Linux/2012-11/73749.htm

Linux下长时间ping网络加时间戳并记录到文本 http://www.linuxidc.com/Linux/2012-09/70440.htm

linux
相关资讯       Linux禁ping 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款