block in log quick on fxp0 proto icmp from any to any icmp-type echo 以上为禁止别人ping我得网络 block return-rst in log on fxp0 proto tcp from any to any flags S/SA block return-icmp(net-unr) in log on fxp0 proto udp from any to any 以上对其他tcp请求,防火墙回应一个RST数据包关闭连接。对UDP请求,防火墙回应网络不可达到的ICMP包。 或者在/etc/sysctl.conf中加入: net.inet.tcp.blackhole=2 net.inet.udp.blackhole=1 能够有效地避免端口扫描 3、然后编辑/etc/rc.conf,加入一下命令,让ipfilter和ipnat在系统启动的时候可以自动加载: ipfilter_enables=”YES” ipf –C –f /etc/ipf.rules ipfilter_flags=”-E” ipnat_enable=”YES” ipnat_program=”/sbin/ipnat –CF -f” ipnat_rules=”/etc/ipnat.rules” ipmon_enable=”YES” ipmon_flags=”-D /var/log/ipfilter.log” 4、在/usr/log/建立文件ipfilter.log,并页码:[1] [2] [3] [4] [5] [6] [7] 第6页、共7页 |