此保护机制会将所有欺骗数据包、源路由数据包和重定向数据包记录到您的日志文件中。
[root@deep] /# for f in /proc/sys/net/ipv4/conf/*/log_martians; do
> echo 1 > $f
> done
|
将上述命令添加到
/etc/rc.d/rc.local脚本文件中,这样下次重启系统时就不必再次输入它们。
编辑
/etc/sysctl.conf文件并添加以下行
# Log Spoofed Packets, Source Routed Packets, Redirect Packets
net.ipv4.conf.all.log_martians = 1
|
您必须重启网络才能使更改生效。手动重启网络的命令如下:
[root@deep] /# /etc/rc.d/init.d/network restart
Setting network parameters [ OK ]
Bringing up interface lo [ OK ]
Bringing up interface eth0 [ OK ]
Bringing up interface eth1 [ OK ]
|