linux系统禁ping代码,Linux系统禁ping

Linux系统禁ping

发布时间:2014-06-11 10:53:59来源:红联作者:velcbo

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

作者:tongcheng

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值