<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Linux 指令简单将攻击IP列入iptables 限制范围</title>
	<atom:link href="http://www.php-oa.com/2008/02/23/linuxzhilingjiandanjianggongjiiplieruiptablesxianzhifanwei.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.php-oa.com/2008/02/23/linuxzhilingjiandanjianggongjiiplieruiptablesxianzhifanwei.html</link>
	<description>Perl Linux CDN Video</description>
	<lastBuildDate>Fri, 10 Feb 2012 01:01:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: 我国著名历史学家</title>
		<link>http://www.php-oa.com/2008/02/23/linuxzhilingjiandanjianggongjiiplieruiptablesxianzhifanwei.html#comment-76</link>
		<dc:creator>我国著名历史学家</dc:creator>
		<pubDate>Wed, 05 Mar 2008 14:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.php-oa.com/2008/02/23/linuxzhilingjiandanjianggongjiiplieruiptablesxianzhifanwei/#comment-76</guid>
		<description>也用曾经有过类似脚本，在cron中定期运行，然后2小时解封。
但是剔除了来自baidu爬虫和google爬虫的IP。
而且封一个C段
剔除搜索引擎ip之后的数据在ip.txt里保存如下格式的ip地址段：
211.95.208.0/24
219.78.190.0/24
64.7.220.0/24
68.163.195.0/24

#!/bin/sh
IPSRC=`cat ip.txt`
for i in $IPSRC;do
	/sbin/iptables -A INPUT -s $i -j REJECT
done

我这用的是iptables -A
注意-A和-I的区别，不要让-A ...REJECT 在一个更宽泛的ACCEPT之后，否则无效</description>
		<content:encoded><![CDATA[<p>也用曾经有过类似脚本，在cron中定期运行，然后2小时解封。<br />
但是剔除了来自baidu爬虫和google爬虫的IP。<br />
而且封一个C段<br />
剔除搜索引擎ip之后的数据在ip.txt里保存如下格式的ip地址段：<br />
211.95.208.0/24<br />
219.78.190.0/24<br />
64.7.220.0/24<br />
68.163.195.0/24</p>
<p>#!/bin/sh<br />
IPSRC=`cat ip.txt`<br />
for i in $IPSRC;do<br />
	/sbin/iptables -A INPUT -s $i -j REJECT<br />
done</p>
<p>我这用的是iptables -A<br />
注意-A和-I的区别，不要让-A &#8230;REJECT 在一个更宽泛的ACCEPT之后，否则无效</p>
]]></content:encoded>
	</item>
</channel>
</rss>

