<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ICT和教育技术</title>
	<atom:link href="http://ict.tigerrr.cn/feed/" rel="self" type="application/rss+xml" />
	<link>http://ict.tigerrr.cn</link>
	<description></description>
	<lastBuildDate>Wed, 01 Sep 2010 05:43:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iptables 中文使用详解</title>
		<link>http://ict.tigerrr.cn/iptables-%e4%b8%ad%e6%96%87%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3/</link>
		<comments>http://ict.tigerrr.cn/iptables-%e4%b8%ad%e6%96%87%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 05:43:35 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/iptables-%e4%b8%ad%e6%96%87%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3/</guid>
		<description><![CDATA[先把我最常用的2个记录下         封ip：iptables -I INPUT -p all -s ip地址 -j DROP
删除被禁止的ip         iptables -nvL &#8211;line-numbers         iptables -D INPUT XXX&#16[......]<p class='read-more'><a href='http://ict.tigerrr.cn/iptables-%e4%b8%ad%e6%96%87%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><span style="line-height: normal; widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font-family: ; white-space: normal; orphans: 2; letter-spacing: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="text-align: left; font-family: " class="Apple-style-span">
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">先把我最常用的2个记录下</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">封ip：iptables -I INPUT -p all -s ip地址 -j DROP</font></font></p>
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">删除被禁止的ip</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables -nvL &#8211;line-numbers </font></font>        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables -D INPUT XXX&#160;&#160;&#160; 注：xxx为行号</font></font></p>
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables 指令</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">语法：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables [-t table] command [match] [-j target/jump]</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">-t</font><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">用来指定规则表，内建的规则表有三个，分别是：nat、mangle 和 filter，当未指定规则表时，则一律视为是 filter。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">个规则表的功能如下：</font><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" id="more-326"></span></font></p>
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">nat 此规则表拥有 Prerouting 和 postrouting 两个规则链，主要功能为进行一对一、一对多、多对多等网址转译工作（SNAT</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">DNAT），由于转译工作的特性，需进行目的地网址转译的封包，就不需要进行来源网址转译，反之亦然，因此为了提升改写封包的</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">率，在防火墙运作时，每个封包只会经过这个规则表一次。如果我们把封包过滤的规则定义在这个数据表里，将会造成无法对同一</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">包进行多次比对，因此这个规则表除了作网址转译外，请不要做其它用途。</font></font></p>
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">mangle 此规则表拥有 Prerouting、FORWARD 和 postrouting 三个规则链。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">除了进行网址转译工作会改写封包外，在某些特殊应用可能也必须去改写封包（TTL、TOS）或者是设定 MARK（将封包作记号，以</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">进行后续的过滤），这时就必须将这些工作定义在 mangle 规则表中，由于使用率不高，我们不打算在这里讨论 mangle 的用法。</font></font></p>
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">filter 这个规则表是预设规则表，拥有 INPUT、FORWARD 和 OUTPUT 三个规则链，这个规则表顾名思义是用来进行封包过滤的</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">理动作（例如：DROP、 LOG、 ACCEPT 或 REJECT），我们会将基本规则都建立在此规则表中。</font></font></p>
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">常用</font><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><font style="font-size: 12pt" color="#002200">列表：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-A, &#8211;append</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT &#8230;</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 新增规则到某个规则链中，该规则将会成为规则链中的最后一条规则。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-D, &#8211;delete</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -D INPUT &#8211;dport 80 -j DROP</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables -D INPUT 1</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 从某个规则链中删除一条规则，可以输入完整规则，或直接指定规则编号加以删除。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-R, &#8211;replace</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -R INPUT 1 -s 192.168.0.1 -j DROP</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 取代现行规则，规则被取代后并不会改变顺序。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-I, &#8211;insert</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -I INPUT 1 &#8211;dport 80 -j ACCEPT</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 插入一条规则，原本该位置上的规则将会往后移动一个顺位。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-L, &#8211;list</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -L INPUT</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 列出某规则链中的所有规则。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-F, &#8211;flush</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -F INPUT</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 删除某规则链中的所有规则。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-Z, &#8211;zero</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -Z INPUT</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 将封包计数器归零。封包计数器是用来计算同一封包出现次数，是过滤阻断式攻击不可或缺的工具。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-N, &#8211;new-chain</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -N allowed</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 定义新的规则链。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-X, &#8211;delete-chain</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -X allowed</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 删除某个规则链。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-P, &#8211;policy</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -P INPUT DROP</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 定义过滤政策。 也就是未符合过滤条件之封包，预设的处理方式。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#008000">命令</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-E, &#8211;rename-chain</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -E allowed disallowed</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 修改某自订规则链的名称。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">常用封包比对</font><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-p, &#8211;protocol</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -p tcp</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 比对通讯协议类型是否相符，可以使用 ! 运算子进行反向比对，例如：-p ! tcp ，意思是指除 tcp 以外的其它类型，包含</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">udp、icmp &#8230;等。如果要比对所有类型，则可以使用 all 关键词，例如：-p all。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-s, &#8211;src, &#8211;source</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -s 192.168.1.1</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对封包的来源 IP，可以比对单机或网络，比对网络时请用数字来表示屏蔽，例如：-s 192.168.0.0/24，比对 IP 时</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">可以使用 ! 运算子进行反向比对，例如：-s ! 192.168.0.0/24。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-d, &#8211;dst, &#8211;destination</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -d 192.168.1.1</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对封包的目的地 IP，设定方式同上。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-i, &#8211;in-interface</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -i eth0</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对封包是从哪片网卡进入，可以使用通配字符 + 来做大范围比对，例如：-i eth+ 表示所有的 ethernet 网卡，也</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">以使用 ! 运算子进行反向比对，例如：-i ! eth0。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-o, &#8211;out-interface</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A FORWARD -o eth0</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对封包要从哪片网卡送出，设定方式同上。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">&#8211;sport, &#8211;source-port</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -p tcp &#8211;sport 22</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对封包的来源埠号，可以比对单一埠，或是一个范围，例如：&#8211;sport 22:80，表示从 22 到 80 埠之间都算是符合</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">件，如果要比对不连续的多个埠，则必须使用 &#8211;multiport</font><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">，详见后文。比对埠号时，可以使用 ! 运算子进行反向比对。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">&#8211;dport, &#8211;destination-port</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -p tcp &#8211;dport 22</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对封包的目的地埠号，设定方式同上。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">&#8211;tcp-flags</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -p tcp &#8211;tcp-flags SYN,FIN,ACK SYN</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 比对 TCP 封包的状态旗号，</font><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">分为两个部分，第一个部分列举出想比对的旗号，第二部分则列举前述旗号中哪些有被设</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">，未被列举的旗号必须是空的。TCP 状态旗号包括：SYN（同步）、ACK（应答）、FIN（结束）、RST（重设）、URG（紧急）</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">PSH（强迫推送） 等均可使用于</font><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">中，除此之外还可以使用关键词 ALL 和 NONE 进行比对。比对旗号时，可以使用 ! 运算子</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">行反向比对。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">&#8211;syn</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -p tcp &#8211;syn</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对是否为要求联机之 TCP 封包，与 iptables -p tcp &#8211;tcp-flags SYN,FIN,ACK SYN 的作用完全相同，如果使用 !</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">运算子，可用来比对非要求联机封包。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m multiport &#8211;source-port</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -p tcp -m multiport &#8211;source-port 22,53,80,110</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对不连续的多个来源埠号，一次最多可以比对 15 个埠，可以使用 ! 运算子进行反向比对。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m multiport &#8211;destination-port</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -p tcp -m multiport &#8211;destination-port 22,53,80,110</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对不连续的多个目的地埠号，设定方式同上。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m multiport &#8211;port</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -p tcp -m multiport &#8211;port 22,53,80,110</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 这个</font><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">比较特殊，用来比对来源埠号和目的埠号相同的封包，设定方式同上。注意：在本范例中，如果来源端口号为 80</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">目的地埠号为 110，这种封包并不算符合条件。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">&#8211;icmp-type</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -p icmp &#8211;icmp-type 8</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对 ICMP 的类型编号，可以使用代码或数字编号来进行比对。请打 iptables -p icmp &#8211;help 来查看有哪些代码可</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">用。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m limit &#8211;limit</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -m limit &#8211;limit 3/hour</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对某段时间内封包的平均流量，上面的例子是用来比对：每小时平均流量是否超过一次 3 个封包。 除了每小时平均</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">次外，也可以每秒钟、每分钟或每天平均一次，默认值为每小时平均一次，</font><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">如后： /second、 /minute、/day。 除了进行封</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">数量的比对外，设定这个</font><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">也会在条件达成时，暂停封包的比对动作，以避免因骇客使用洪水攻击法，导致服务被阻断。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">&#8211;limit-burst</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -m limit &#8211;limit-burst 5</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对瞬间大量封包的数量，上面的例子是用来比对一次同时涌入的封包是否超过 5 个（这是默认值），超过此上限的封</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">将被直接丢弃。使用效果同上。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m mac &#8211;mac-source</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -m mac &#8211;mac-source 00:00:00:00:00:01</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对封包来源网络接口的硬件地址，这个</font><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">不能用在 OUTPUT 和 Postrouting 规则炼上，这是因为封包要送出到网</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">后，才能由网卡驱动程序透过 ARP 通讯协议查出目的地的 MAC 地址，所以 iptables 在进行封包比对时，并不知道封包会送到</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">个网络接口去。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">&#8211;mark</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -t mangle -A INPUT -m mark &#8211;mark 1</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对封包是否被表示某个号码，当封包被比对成功时，我们可以透过 MARK 处理动作，将该封包标示一个号码，号码最</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">不可以超过 4294967296。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m owner &#8211;uid-owner</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A OUTPUT -m owner &#8211;uid-owner 500</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对来自本机的封包，是否为某特定使用者所产生的，这样可以避免服务器使用 root 或其它身分将敏感数据传送出</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">，可以降低系统被骇的损失。可惜这个功能无法比对出来自其它主机的封包。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m owner &#8211;gid-owner</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A OUTPUT -m owner &#8211;gid-owner 0</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对来自本机的封包，是否为某特定使用者群组所产生的，使用时机同上。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m owner &#8211;pid-owner</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A OUTPUT -m owner &#8211;pid-owner 78</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对来自本机的封包，是否为某特定行程所产生的，使用时机同上。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m owner &#8211;sid-owner</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A OUTPUT -m owner &#8211;sid-owner 100</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对来自本机的封包，是否为某特定联机（Session ID）的响应封包，使用时机同上。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><font style="font-size: 12pt" color="#002200">-m state &#8211;state</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">范例 iptables -A INPUT -m state &#8211;state RELATED,ESTABLISHED</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">说明 用来比对联机状态，联机状态共有四种：INVALID、ESTABLISHED、NEW 和 RELATED。</font></font></p>
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">INVALID 表示该封包的联机编号（Session ID）无法辨识或编号不正确。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">ESTABLISHED 表示该封包属于某个已经建立的联机。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">NEW 表示该封包想要起始一个联机（重设联机或将联机重导向）。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">RELATED 表示该封包是属于某个已经建立的联机，所建立的新联机。例如：FTP-DATA 联机必定是源自某个 FTP 联机。</font></font></p>
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">常用的处理动作：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">-j</font><span class="Apple-converted-space"><font style="font-size: 12pt" color="#002200">&#160;</font></span><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font style="font-size: 12pt" color="#ff0000">参数</font></span><font style="font-size: 12pt" color="#002200">用来指定要进行的处理动作，常用的处理动作包括：ACCEPT、REJECT、DROP、REDIRECT、MASQUERADE、LOG、DNAT、</font></font></p>
<p style="padding-bottom: 0px; line-height: 18pt; margin: 19px 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><font face="Georgia"><font style="font-size: 12pt" color="#002200">SNAT、MIRROR、QUEUE、RETURN、MARK，分别说明如下：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">ACCEPT 将封包放行，进行完此处理动作后，将不再比对其它规则，直接跳往下一个规则炼（natostrouting）。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">REJECT 拦阻该封包，并传送封包通知对方，可以传送的封包有几个选择：ICMP port-unreachable、ICMP echo-reply 或是</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">tcp-reset（这个封包会要求对方关闭联机），进行完此处理动作后，将不再比对其它规则，直接 中断过滤程序。 范例如下：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables -A FORWARD -p TCP &#8211;dport 22 -j REJECT &#8211;reject-with tcp-reset</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">DROP 丢弃封包不予处理，进行完此处理动作后，将不再比对其它规则，直接中断过滤程序。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">REDIRECT 将封包重新导向到另一个端口（PNAT），进行完此处理动作后，将 会继续比对其它规则。 这个功能可以用来实作通透式</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">porxy 或用来保护 web 服务器。例如：iptables -t nat -A PREROUTING -p tcp &#8211;dport 80 -j REDIRECT &#8211;to-ports 8080</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">MASQUERADE 改写封包来源 IP 为防火墙 NIC IP，可以指定 port 对应的范围，进行完此处理动作后，直接跳往下一个规则</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">（mangleostrouting）。这个功能与 SNAT 略有不同，当进行 IP 伪装时，不需指定要伪装成哪个 IP，IP 会从网卡直接读</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">，当使用拨接连线时，IP 通常是由 ISP 公司的 DHCP 服务器指派的，这个时候 MASQUERADE 特别有用。范例如下：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables -t nat -A POSTROUTING -p TCP -j MASQUERADE &#8211;to-ports 1024-31000</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">LOG 将封包相关讯息纪录在 /var/log 中，详细位置请查阅 /etc/syslog.conf 组态档，进行完此处理动作后，将会继续比对其</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">规则。例如：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables -A INPUT -p tcp -j LOG &#8211;log-prefix &quot;INPUT packets&quot;</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">SNAT 改写封包来源 IP 为某特定 IP 或 IP 范围，可以指定 port 对应的范围，进行完此处理动作后，将直接跳往下一个规则</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">（mangleostrouting）。范例如下：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables -t nat -A POSTROUTING -p tcp-o eth0 -j SNAT &#8211;to-source 194.236.50.155-194.236.50.160:1024-32000</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">DNAT 改写封包目的地 IP 为某特定 IP 或 IP 范围，可以指定 port 对应的范围，进行完此处理动作后，将会直接跳往下一个规</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">炼（filter:input 或 filter:forward）。范例如下：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables -t nat -A PREROUTING -p tcp -d 15.45.23.67 &#8211;dport 80 -j DNAT &#8211;to-destination</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">192.168.1.1-192.168.1.10:80-100</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">MIRROR 镜射封包，也就是将来源 IP 与目的地 IP 对调后，将封包送回，进行完此处理动作后，将会中断过滤程序。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">QUEUE 中断过滤程序，将封包放入队列，交给其它程序处理。透过自行开发的处理程序，可以进行其它应用，例如：计算联机费</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">&#8230;&#8230;.等。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">RETURN 结束在目前规则炼中的过滤程序，返回主规则炼继续过滤，如果把自订规则炼看成是一个子程序，那么这个动作，就相当</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">提早结束子程序并返回到主程序中。</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">MARK 将封包标上某个代号，以便提供作为后续过滤的条件判断依据，进行完此处理动作后，将会继续比对其它规则。范例如下：</font></font>         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><font face="Georgia"><font style="font-size: 12pt" color="#002200">iptables -t mangle -A PREROUTING -p tcp &#8211;dport 22 -j MARK &#8211;set-mark 2</font></font></p>
<p>   </span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/iptables-%e4%b8%ad%e6%96%87%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux iptables 如何封IP段</title>
		<link>http://ict.tigerrr.cn/linux-iptables-%e5%a6%82%e4%bd%95%e5%b0%81ip%e6%ae%b5/</link>
		<comments>http://ict.tigerrr.cn/linux-iptables-%e5%a6%82%e4%bd%95%e5%b0%81ip%e6%ae%b5/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 05:39:59 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/linux-iptables-%e5%a6%82%e4%bd%95%e5%b0%81ip%e6%ae%b5/</guid>
		<description><![CDATA[124.115.*.*这个ip段非常恶心，建议在服务器上都封锁       # iptables -F        # iptables -P INPUT ACCEPT        # iptables -P OUTPUT ACCEPT        # iptables -P FORWARD [......]<p class='read-more'><a href='http://ict.tigerrr.cn/linux-iptables-%e5%a6%82%e4%bd%95%e5%b0%81ip%e6%ae%b5/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="text-align: left; font-family: georgia; color: rgb(0,34,0); font-size: 16px" class="Apple-style-span">
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 1.2em 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">124.115.*.*这个ip段非常恶心，建议在服务器上都封锁       <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /># iptables -F        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /># iptables -P INPUT ACCEPT        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /># iptables -P OUTPUT ACCEPT        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /># iptables -P FORWARD ACCEPT        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /># iptables -A FORWARD -s 124.115.0.0/24 -j DROP        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /># iptables -I FORWARD -d 202.96.170.164 -j DROP</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 1.2em 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">补充：：</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" class="t_msgfont">封单个IP的命令是：       <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -I INPUT -s 211.1.0.0 -j DROP
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 1.2em 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 1.2em 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">封IP段的命令是：         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -I INPUT -s 211.1.0.0/16 -j DROP          <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -I INPUT -s 211.2.0.0/16 -j DROP          <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -I INPUT -s 211.3.0.0/16 -j DROP</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 1.2em 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">封整个段的命令是：         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -I INPUT -s 211.0.0.0/8 -j DROP</p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 1.2em 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">封几个段的命令是：         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -I INPUT -s 61.37.80.0/24 -j DROP          <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -I INPUT -s 61.37.81.0/24 -j DROP</p>
</p></div>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" class="t_msgfont">想在服务器启动自运行的话有三个方法：       <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />1、把它加到/etc/rc.local中        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />2、iptables-save &gt;;/etc/sysconfig/iptables可以把你当前的iptables规则放到/etc/sysconfig/iptables中，系统启动iptables时自动执行。        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />3、service iptables save 也可以把你当前的iptables规则放/etc/sysconfig/iptables中，系统启动iptables时自动执行。        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />后两种更好此，一般iptables服务会在network服务之前启来，更安全。
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 1.2em 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"></p>
<p style="padding-bottom: 0px; line-height: 1.5em; margin: 1.2em 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">解封的话：         <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -D INPUT -s IP地址 -j REJECT          <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -F 全清掉了</p>
</p></div>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" class="t_msgfont">刚才不小心搞的自己都连不上了-_-!!!       <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />iptables -I INPUT -p tcp &#8211;dport 80 -s 124.115.0.0/24 -j DROP        <br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />以后用这种只封80端口就行了，不会出问题!&#160; </div>
<p>   </span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/linux-iptables-%e5%a6%82%e4%bd%95%e5%b0%81ip%e6%ae%b5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel 公式</title>
		<link>http://ict.tigerrr.cn/excel-%e5%85%ac%e5%bc%8f/</link>
		<comments>http://ict.tigerrr.cn/excel-%e5%85%ac%e5%bc%8f/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 04:55:25 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[excel]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/excel-%e5%85%ac%e5%bc%8f/</guid>
		<description><![CDATA[1.Excel公式中如果想要$B1这个值不会随着Excel的拖动而变动，也就是是一个常量，可以写成这样的$B$1
2.IF函数：IF函数是Excel 逻辑函数的中最常用的函数，语法形式为:    IF（logical_test,value_if_true,value_if_false)     If[......]<p class='read-more'><a href='http://ict.tigerrr.cn/excel-%e5%85%ac%e5%bc%8f/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>1.Excel公式中如果想要$B1这个值不会随着Excel的拖动而变动，也就是是一个常量，可以写成这样的$B$1</p>
<p>2.IF函数：IF函数是Excel 逻辑函数的中最常用的函数，语法形式为:    <br />IF（logical_test,value_if_true,value_if_false)     <br />If 函数的作用是根据logical_test逻辑计算的真假值，返回不同的结果。IF函数最多可以嵌套7层。</p>
<p>3.COUNTIF函数,也是很常用的一个函数,具体语法形式为:    <br />COUNTIF(range,criteria)     <br />Range 区域 是一个或多个要计数的单元格，其中包括数字或名称、数组或包含数字的引用。空值和文本值将被忽略。     <br />Criteria 为确定哪些单元格将被计算在内的条件，其形式可以为数字、表达式、单元格引用或文本。例如，条件可以表示为 32、&quot;32&quot;、&quot;&gt;32&quot; 、&quot;apples&quot; 或 B4。 </p>
<p>这几个函数很常用,不过过段时间就会忘记,记到这里备忘</p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/excel-%e5%85%ac%e5%bc%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blackboard 8.0 查找Content Collection内使用个人资源的用户列表</title>
		<link>http://ict.tigerrr.cn/blackboard-8-0-%e6%9f%a5%e6%89%becontent-collection%e5%86%85%e4%bd%bf%e7%94%a8%e4%b8%aa%e4%ba%ba%e8%b5%84%e6%ba%90%e7%9a%84%e7%94%a8%e6%88%b7%e5%88%97%e8%a1%a8/</link>
		<comments>http://ict.tigerrr.cn/blackboard-8-0-%e6%9f%a5%e6%89%becontent-collection%e5%86%85%e4%bd%bf%e7%94%a8%e4%b8%aa%e4%ba%ba%e8%b5%84%e6%ba%90%e7%9a%84%e7%94%a8%e6%88%b7%e5%88%97%e8%a1%a8/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 10:51:31 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[经验]]></category>
		<category><![CDATA[blackboard]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/blackboard-8-0-%e6%9f%a5%e6%89%becontent-collection%e5%86%85%e4%bd%bf%e7%94%a8%e4%b8%aa%e4%ba%ba%e8%b5%84%e6%ba%90%e7%9a%84%e7%94%a8%e6%88%b7%e5%88%97%e8%a1%a8/</guid>
		<description><![CDATA[由于P大的bb系统用户帐号进行过一次有规律的升级，当时采取的策略是，按照规律批量新建帐号，从bb系统中批量导出用户和课程的注册关系，并修改用户id后重新导入系统，这基本解决了问题，不过也留下后遗症，Content Collection与用户之间的所属关系并未完全复制还原，如果删除升级前的帐号，部分老[......]<p class='read-more'><a href='http://ict.tigerrr.cn/blackboard-8-0-%e6%9f%a5%e6%89%becontent-collection%e5%86%85%e4%bd%bf%e7%94%a8%e4%b8%aa%e4%ba%ba%e8%b5%84%e6%ba%90%e7%9a%84%e7%94%a8%e6%88%b7%e5%88%97%e8%a1%a8/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>由于P大的bb系统用户帐号进行过一次有规律的升级，当时采取的策略是，按照规律批量新建帐号，从bb系统中批量导出用户和课程的注册关系，并修改用户id后重新导入系统，这基本解决了问题，不过也留下后遗症，Content Collection与用户之间的所属关系并未完全复制还原，如果删除升级前的帐号，部分老师在课程里引用了bb Content Collection的个人资源，那么课程内部分引用自旧账号个人资源的内容就会出现死链。为了既能清理旧帐号腾出宝贵的帐号空间，又丢失现有课程的部分资源，可以这么做：在Content Collection搜索/users/目录下的文件夹，如果大于1024字节，那么表示这个文件夹内有内容，不能直接删除该帐号，获得这样的一个列表容量大于1k的文件夹列表，删除重复的内容，再做一些处理就可以得到在Content Collection个人资源里有内容的用户列表，针对这个列表单独处理，备份复制资源，然后就可以按照规则删除旧有帐号了。</p>
<p>具体使用的工具是后台的管理员搜索，<strong>管理员面板</strong> &gt; <strong>管理员搜索</strong> &gt; <strong>搜索，</strong>设定一下搜索类型为文件夹，搜索范围为/users，大小为大于1024字节，即可。</p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/blackboard-8-0-%e6%9f%a5%e6%89%becontent-collection%e5%86%85%e4%bd%bf%e7%94%a8%e4%b8%aa%e4%ba%ba%e8%b5%84%e6%ba%90%e7%9a%84%e7%94%a8%e6%88%b7%e5%88%97%e8%a1%a8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu上部署iSCSI</title>
		<link>http://ict.tigerrr.cn/ubuntu%e4%b8%8a%e9%83%a8%e7%bd%b2iscsi/</link>
		<comments>http://ict.tigerrr.cn/ubuntu%e4%b8%8a%e9%83%a8%e7%bd%b2iscsi/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 09:59:08 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[虚拟化]]></category>
		<category><![CDATA[iscsi]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/ubuntu%e4%b8%8a%e9%83%a8%e7%bd%b2iscsi/</guid>
		<description><![CDATA[<strong>一、iSCSI技术      </strong>SAN（Storage Area Network的缩写）意为存储区域网络，是真正的专注于企业级的存储。SAN采用一个分离的网络（从传统的局域网中分离）连接所有的存储器和服务器，这个网络可以采用高性能的实现技术，如光纤通道（Fiber Channel），可以容纳SCSI等[......]<p class='read-more'><a href='http://ict.tigerrr.cn/ubuntu%e4%b8%8a%e9%83%a8%e7%bd%b2iscsi/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>一、iSCSI技术      <br /></strong>SAN（Storage Area Network的缩写）意为存储区域网络，是真正的专注于企业级的存储。SAN采用一个分离的网络（从传统的局域网中分离）连接所有的存储器和服务器，这个网络可以采用高性能的实现技术，如光纤通道（Fiber Channel），可以容纳SCSI等协议，使数据块的移动更为有效，也便于用户自由增加磁盘阵列、磁带库或服务器等设备。现在的SAN基本都是通过Fibre Channel来实现的，Fibre Channel，简称FIBRE CHANNEL，又称光纤通道，是利用专用设备进行数据高速传输的一种网络标准，主要用于连接服务器的干线（backbones），并把服务器连接到存储设备上。采用高速的FIBRE CHANNEL作为传输媒介的SAN具有光纤信道在距离、性能和连接性等方面的优势，如果结合光纤通道交换机，则可以提供高达2Gb/s的数据传输速率，使独立于应用服务器网络系统之外的SAN几乎拥有了无限的存储能力。 但是利用FIBRE CHANNEL实现的SAN虽然性能优越，扩展性极佳，但价格却贵得惊人，管理起来也非常困难，让一般用户难以承受。也是许多企业不得不忍痛放弃SAN的原因。iSCSI（互联网小型计算机系统接口）是一种在Internet协议网络上，特别是以太网上进行数据块传输的标准，是一种集成了IP和SCSI的技术。它最大的特点就是让标准的SCSI命令能够在TCP/IP网络上的主机系统（启动器）和存储设备（目标）之间传送。与光纤通道相比，iSCSI具有许多优势，用‘iSCSI=低廉+高性能’这个等式来表示再恰当不过了。iSCSI是基于IP协议的技术标准，实现了SCSI和TCP/IP协议的连接，那些以局域网为网络环境的用户只需要少量的投入，就可以方便、快捷地对信息和数据进行交互式传输和管理。相对于以往的网络接入存储，iSCSI的产生解决了开放性、容量、传输速度以及兼容性等许多问题，让用户可以通过现有的TCP/IP网络来构建存储区域网，能够更容易地管理SAN存储。</p>
<p>&#160; <br /><strong>二、Ubuntu上部署（使用9.04版本）</strong>     <br />iscsi中target是提供磁盘的一端，而initiator是使用磁盘的一端！     <br />Ubuntu下部署比较简单，使用的是直接apt-get installl，不是源码安装：     <br />sudo apt-get install iscsitarget     <br />sudo apt-get install open-iscsi     <br />然后编辑配置文件：     <br />sudo vim /etc/ietd.conf     <br />默认的配置文件，有详细的配置说明和示例，就修改了部分（最好做好注释或者备份）     <br />iSNSServer 192.168.1.81（iSCSI服务所工作在的IP地址）     <br />iSNSAccessControl No     <br />Target iqn.2009-11.com.example:storage.disk2.sys1.xyz     <br />&#160;&#160;&#160; Lun 0 Path=/home/jiang/iscsi,Type=fileio     <br />&#160;&#160;&#160; Alias test     <br />iSNSAccessControl No，这个我也没看太明白，似乎是不允许访问者对iSCSI进行控制；     <br />Target iqn.2009-11.com.example:storage.disk2.sys1.xyz：开启一个Target，并且这个Target命名为：iqn.2009-11.com.example:storage.disk2.sys1.xyz     <br />Lun 0 Path=/home/jiang/iscsi,Type=fileio：给刚才那个命名为 iqn.2009-04==11.com.example:storage.disk2.sys1.xyz的Target分配一个卷，测试就以本地作为存储的设备（最好应该是用个专用硬盘），类型为fileio     <br />Alias test：设置一个别名：test；     <br />保存，重启iscsi target用这个命令：     <br />sudo /etc/init.d/iscsitarget restart     <br />接着就是出现如下的提示：     <br />Removing iSCSI enterprise target devices: succeeded.     <br />Stopping iSCSI enterprise target service: succeeded.     <br />Removing iSCSI enterprise target modules: succeeded.     <br />Starting iSCSI enterprise target service: succeeded.     <br />&#160;&#160;&#160;&#160; 说明我的iSCSI服务已经正常运行了，进入Windows，装上Microsoft iSCSI&#160; Initiator，到Discovery里添加192.168.1.81这个Target Portals，到Tragets里刷新，立刻发现了“iqn.2009-04.com.example:storage.disk2.sys1.xyz”，马上log On，Windows发现新的磁盘，分区、格式化，投入使用。     </p>
<p> <strong></strong>
<p><strong>三、troubleshooting:      <br /></strong>1）如果在iscsi target步骤出现     <br />iscsitarget not enabled in &quot;/etc/default/iscsitarget&quot;     <br />只需到将此文件的false改为true即可 </p>
<p>2）Windows 7下使用iSCSI设备    <br />Windows 7下自带了发起iSCSI设备的的程序，不需要安装Microsoft iSCSI Initiator了，但默认是关闭的，开启方式有两种：     <br />一 开始菜单，在搜索项里搜索“ISCSI”，会找到一个ISCSI 发起程序，运行即可打开；     <br />二 直接我的电脑，右键-管理-服务，打开&quot;Microsoft iSCSI Initiator Service&quot;服务就行了！</p>
<p> 参考：   <br />1.<a href="http://zhidao.baidu.com/question/125001626">http://zhidao.baidu.com/question/125001626</a>   <br />2.<a href="http://jiangshuiy.javaeye.com/blog/518478">http://jiangshuiy.javaeye.com/blog/518478</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/ubuntu%e4%b8%8a%e9%83%a8%e7%bd%b2iscsi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows 7 :&#8220;您没有权限修改该网络位置的文件，请与管理员联系以获得修改权限&#8221;</title>
		<link>http://ict.tigerrr.cn/windows-7-%e6%82%a8%e6%b2%a1%e6%9c%89%e6%9d%83%e9%99%90%e4%bf%ae%e6%94%b9%e8%af%a5%e7%bd%91%e7%bb%9c%e4%bd%8d%e7%bd%ae%e7%9a%84%e6%96%87%e4%bb%b6%ef%bc%8c%e8%af%b7%e4%b8%8e%e7%ae%a1%e7%90%86/</link>
		<comments>http://ict.tigerrr.cn/windows-7-%e6%82%a8%e6%b2%a1%e6%9c%89%e6%9d%83%e9%99%90%e4%bf%ae%e6%94%b9%e8%af%a5%e7%bd%91%e7%bb%9c%e4%bd%8d%e7%bd%ae%e7%9a%84%e6%96%87%e4%bb%b6%ef%bc%8c%e8%af%b7%e4%b8%8e%e7%ae%a1%e7%90%86/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 08:17:09 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[经验]]></category>
		<category><![CDATA[nod32]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/windows-7-%e6%82%a8%e6%b2%a1%e6%9c%89%e6%9d%83%e9%99%90%e4%bf%ae%e6%94%b9%e8%af%a5%e7%bd%91%e7%bb%9c%e4%bd%8d%e7%bd%ae%e7%9a%84%e6%96%87%e4%bb%b6%ef%bc%8c%e8%af%b7%e4%b8%8e%e7%ae%a1%e7%90%86/</guid>
		<description><![CDATA[<p>遇到这个问题很久很久了，一直没在意，今天搜了一下，发现原来是nod32搞的鬼，修改一下就好了：</p>
<p><strong>设置</strong> &#8211; <strong>高级模式</strong> &#8211; <strong>打开所有高级设置</strong> &#8211; <strong>文件系统实时防护</strong> &#8211; <strong>文件创建时</strong></p>
<p>取消打钩</p>]]></description>
			<content:encoded><![CDATA[<p>遇到这个问题很久很久了，一直没在意，今天搜了一下，发现原来是nod32搞的鬼，修改一下就好了：</p>
<p><strong>设置</strong> &#8211; <strong>高级模式</strong> &#8211; <strong>打开所有高级设置</strong> &#8211; <strong>文件系统实时防护</strong> &#8211; <strong>文件创建时</strong></p>
<p>取消打钩</p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/windows-7-%e6%82%a8%e6%b2%a1%e6%9c%89%e6%9d%83%e9%99%90%e4%bf%ae%e6%94%b9%e8%af%a5%e7%bd%91%e7%bb%9c%e4%bd%8d%e7%bd%ae%e7%9a%84%e6%96%87%e4%bb%b6%ef%bc%8c%e8%af%b7%e4%b8%8e%e7%ae%a1%e7%90%86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress常用函数-get_option()</title>
		<link>http://ict.tigerrr.cn/wordpress%e5%b8%b8%e7%94%a8%e5%87%bd%e6%95%b0-get_option/</link>
		<comments>http://ict.tigerrr.cn/wordpress%e5%b8%b8%e7%94%a8%e5%87%bd%e6%95%b0-get_option/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 18:12:40 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[wordpress开发]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[函数]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/wordpress%e5%b8%b8%e7%94%a8%e5%87%bd%e6%95%b0-get_option/</guid>
		<description><![CDATA[这个函数很好用哇，可以随便取数据库里的值了
说明
这是一种从选项数据库表中获取有名称的选项的值的安全方法。如果所需选项不存在，或选项无相关值，函数返回<strong>FALSE</strong>。
用法
&#60;?php echo get_option( $show ); ?&#62;
参数
<str[......]<p class='read-more'><a href='http://ict.tigerrr.cn/wordpress%e5%b8%b8%e7%94%a8%e5%87%bd%e6%95%b0-get_option/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<h5><font color="#0000ff" size="3">这个函数很好用哇，可以随便取数据库里的值了</font></h5>
<h5>说明</h5>
<p>这是一种从选项数据库表中获取有名称的选项的值的安全方法。如果所需选项不存在，或选项无相关值，函数返回<strong>FALSE</strong>。</p>
<h5>用法</h5>
<p>&lt;?php echo get_option( $show ); ?&gt;</p>
<h5>参数</h5>
<p><strong>$show</strong></p>
<p>（字符串）（必需）需要检索的选项名称。</p>
<p>默认值：None</p>
<p><strong>$default</strong></p>
<p>（混合）（可选）无值可返回时返回的默认值（如选项不在数据库中时）</p>
<p>默认值：false</p>
<h5>返回的值</h5>
<p>更多信息请见<a href="http://codex.wordpress.org/Option_Reference">http://codex.wordpress.org/Option_Reference</a></p>
<h5>示例</h5>
<p><strong>显示博客名称</strong></p>
<p>在&lt;h1&gt;标签中显示博客名称</p>
<p>&lt;h1&gt;&lt;?php echo get_option(&#8216;blogname&#8217;); ?&gt;&lt;/h1&gt;</p>
<p><strong>显示字符集</strong></p>
<p>显示当前博客所用的字符集（假设为UTF-8）</p>
<p>&lt;p&gt;Character set: &lt;?php echo get_option(&#8216;blog_charset&#8217;); ?&gt; &lt;/p&gt; </p>
<p><strong>查看网站管理员的E-mail</strong></p>
<p>检索博客管理员的电子邮件地址并存储在变量中</p>
<p>&lt;?php $admin_email = get_option(&#8216;admin_email&#8217;); ?&gt; </p>
<p>转载自：<a href="http://www.wordpress.la/codex-%E5%B8%B8%E7%94%A8%E5%87%BD%E6%95%B0-get_option%28%29.html" target="_blank">WordPress啦</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/wordpress%e5%b8%b8%e7%94%a8%e5%87%bd%e6%95%b0-get_option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress条件标签</title>
		<link>http://ict.tigerrr.cn/wordpress%e6%9d%a1%e4%bb%b6%e6%a0%87%e7%ad%be/</link>
		<comments>http://ict.tigerrr.cn/wordpress%e6%9d%a1%e4%bb%b6%e6%a0%87%e7%ad%be/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 18:08:46 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[wordpress开发]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[函数]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/wordpress%e6%9d%a1%e4%bb%b6%e6%a0%87%e7%ad%be/</guid>
		<description><![CDATA[条件标签
简介
在模板文件中，我们可以根据能与某页面相匹配的条件，利用条件标签更改该页面上将要显示的内容以及内容的显示方式。例如，如果希望在博客首页文章列表的上方显示一段文字，可以利用 <a href="http://www.wordpress.la/codex-%E6%9D%A1%E4%BB%B6[......]<p class='read-more'><a href='http://ict.tigerrr.cn/wordpress%e6%9d%a1%e4%bb%b6%e6%a0%87%e7%ad%be/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<h4>条件标签</h4>
<h5>简介</h5>
<p>在模板文件中，我们可以根据能与某页面相匹配的条件，利用条件标签更改该页面上将要显示的内容以及内容的显示方式。例如，如果希望在博客首页文章列表的上方显示一段文字，可以利用 <a href="http://www.wordpress.la/codex-%E6%9D%A1%E4%BB%B6%E6%A0%87%E7%AD%BE.html#is_home">is_home()</a>条件标签轻松实现这一效果。</p>
<p>注意：条件标签与WordPress<a href="http://www.wordpress.la/codex-%E6%A8%A1%E6%9D%BF%E5%B1%82%E7%BA%A7.html">模板层级</a>密切相关。</p>
<h5>条件</h5>
<p>所有条件标签都会检查是否有条件可符合相应页面，之后返回TRUE或者FALSE。下面列出能够使各个条件标签返回TRUE的条件：</p>
<h6><a name="is_home">主页</a></h6>
<p><strong>is_home()</strong></p>
<p>显示博客主页时，该条件标签返回TRUE。</p>
<p><strong>注意</strong>：如果将静态页面作为博客主页，该标签会在显示日志页面时返回TRUE。</p>
<h6><a name="is_front_page">标题页</a></h6>
<p><strong>is_front_page()</strong></p>
<p>显示博客头版消息（无论是日志或是页面）。当系统显示博客主页且管理面板的<strong>设置</strong>&gt;<strong>阅读</strong>菜单下“<strong>主页显示为</strong>”选项设为最近发表的文章”，或者&#8217;<strong>设置</strong>&gt;<strong>阅读</strong>菜单下“<strong>主页显示为</strong>”选项设为且&quot;主页&quot;是当前被显示的页面时，is_front_page()标签返回TRUE。注意：该标签在WordPress 2.5版本中首次亮相。</p>
<h6><a name="is_admin">管理栏</a></h6>
<p><strong>is_admin()</strong></p>
<p>显示控制板或管理栏时，is_admin()标签返回TRUE。</p>
<h6><a name="is_single">单篇日志页面</a></h6>
<p><strong>is_single()</strong></p>
<p>显示任何单独一篇日志时，is_single()标签返回TRUE。</p>
<p><strong>is_single(&#8217;17&#8242;)</strong></p>
<p>显示编号为17的单篇日志时，该标签返回TRUE。</p>
<p><strong>is_single(&#8216;Irish Stew&#8217;)</strong></p>
<p>显示标题为&quot;Irish Stew&quot;的单篇日志时，该标签返回TRUE。</p>
<p><strong>is_single(&#8216;beef-stew&#8217;)</strong></p>
<p>显示别名为&quot;beef-stew&quot;的单篇日志时，该标签返回TRUE。</p>
<p><strong>is_single(array(17,&#8217;beef-stew&#8217;,'Irish Stew&#8217;))</strong></p>
<p>当所显示的单篇日志编号为17，或post_name为&quot;beef-stew&quot;，或post_title为&quot;Irish Stew&quot;时，is_single(array(17,&#8217;beef-stew&#8217;,'Irish Stew&#8217;))标签返回TRUE。注意：数组功能首次出现于WordPress 2.5。</p>
<h6><a href="http://www.wordpress.la/">置顶日志</a></h6>
<p><strong>is_sticky()</strong></p>
<p>若当前日志的&quot;Stick this post to the front page（将该日志在首页置顶）&quot;复选框被选中，is_sticky()返回TRUE。此时标签没有提供日志的编号变量，因此系统会用到<a href="http://www.wordpress.la/codex-WordPress%E4%B8%BB%E5%BE%AA%E7%8E%AF.html">WordPress主循环the Loop</a>的日志编号。注意：该标签首次出现于WordPress 2.7。</p>
<p><strong>is_sticky(&#8217;17&#8242;)</strong></p>
<p>若编号为17的日志被置顶，该标签返回TRUE。</p>
<h6>评论弹出式窗口</h6>
<p><strong>is_comments_popup()</strong></p>
<p>显示的内容在评论弹出式窗口中时，该标签返回TRUE。</p>
<h6>任何包含日志的页面</h6>
<p><strong>comments_open()</strong></p>
<p>若评论允许当前日志在<a href="http://www.wordpress.la/codex-WordPress%E4%B8%BB%E5%BE%AA%E7%8E%AF.html">WordPress主循环</a>中运行，该标签返回TRUE。</p>
<p><strong>pings_open()</strong></p>
<p>若引用通告ping允许当前日志在<a href="http://www.wordpress.la/codex-WordPress%E4%B8%BB%E5%BE%AA%E7%8E%AF.html">WordPress主循环</a>中运行，该标签返回TRUE。</p>
<h6><a name="is_page">PAGE页面</a></h6>
<p>这里的PAGE指的是WordPress的“<a href="http://www.wordpress.la/codex-%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8.html">页面</a>”功能，而不是博客生成的网页。</p>
<p><strong>is_page()</strong></p>
<p>显示任何一篇<a href="http://www.wordpress.la/codex-%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8.html">页面</a>时，该标签返回TRUE。</p>
<p><strong>is_page(&#8217;42&#8242;)</strong></p>
<p>显示编号为42的<a href="http://www.wordpress.la/codex-%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8.html">页面</a>时，该标签返回TRUE。</p>
<p><strong>is_page(&#8216;About Me And Joe&#8217;)</strong></p>
<p>若显示的<a href="http://www.wordpress.la/codex-%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8.html">页面</a>的post_name为&quot;About Me And Joe&quot;，该标签返回TRUE。</p>
<p><strong>is_page(&#8216;about-me&#8217;)</strong></p>
<p>若显示的<a href="http://www.wordpress.la/codex-%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8.html">页面</a>的post_name（别名）为&quot;about-me&quot;，该标签返回TRUE。</p>
<p><strong>is_page(array(42,&#8217;about-me&#8217;,'About Me And Joe&#8217;))</strong></p>
<p>当所显示的<a href="http://www.wordpress.la/codex-%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8.html">页面</a>编号为42，或post_name为&quot;about-me&quot;，或post_title为&quot;About Me And Joe&quot;时，is_page(array(42,&#8217;about-me&#8217;,'About Me And Joe&#8217;))标签返回TRUE。注意：数组功能首次出现于WordPress 2.5。</p>
<h6>子页面</h6>
<p>目前is_subpage()函数尚未出现，但我们可以用以下代码来判断某页面是否子页面：</p>
<pre>&lt;?php
// Get $post if you're inside a function
global $post;

if ( is_page() &amp;&amp; $post-&gt;post_parent ) {
    // This is a subpage

} else {
    // This is not a subpage
}
?&gt;</pre>
<p>也可以将这一功能添加到functions.php文件中：</p>
<pre>function is_tree($pid) {    // $pid = The page we're looking for pages underneath
	global $post;       // We load this as we're outside of the post
	if(is_page()&amp;&amp;($post-&gt;post_parent==$pid||is_page($pid))) return true; // Yes, it's in the tree
	else return false;  // No, it's outside
};</pre>
<p>然后调用is_tree(&#8216;id&#8217;)来判断页面是否在目录树中。在下面的代码示例中，我们可以用is_tree(&#8217;2&#8242;)来代替第一个if标签中的&quot;is_page(&#8216;about&#8217;) || $post-&gt;post_parent == &#8217;2&#8242;&quot;。注意，如果有两层以上页面，父页面指的是子页面的上一级页面而不是顶级页面。</p>
<p>如果要判断当前页面是否是某个特定页面或者是否是某一页面的子页面（例如在一个基于页面的网站的不同版块上显示不同banner广告），可以先从后台获取父页面的ID，然后按以下方式进行编码：</p>
<pre>&lt;?php

if ( is_page('about') || $post-&gt;post_parent == '2' ) {
    $bannerimg = 'home.jpg';

} elseif ( is_page('learning') || $post-&gt;post_parent == '56' ) {
    $bannerimg = 'teaching.jpg';

} elseif ( is_page('admissions') || $post-&gt;post_parent == '15' ) {
    $bannerimg = 'admissions.jpg';

} else {
    $bannerimg = 'home.jpg'; // Fall-through
}	

?&gt;</pre>
<p>如果希望进行多次页面判断，最好创建一个长期函数（is_cpage()）。例如，如果将is_subpage()引入wp，用户就可以在functions.php文件中修改函数而不必做其它多余改动了。</p>
<h6>Is a Page模板</h6>
<p>自WordPress 2.5版起，用户可以通过Is a Page模板来判断目前是否位于页面模板中，或是否在使用某个特定的页面模板。</p>
<p><strong>is_page_template() </strong></p>
<p>目前是否使用了页面模板</p>
<p><strong>is_page_template(&#8216;about.php&#8217;) </strong></p>
<p>是否使用页面模板&#8217;about&#8217;？注意：页面模板与其它条件标签有所不同，用户需要使用文件名（如 about.php 或my_page_template.php）来指定某个页面模板。</p>
<h6><a name="is_category">类别页面</a></h6>
<p><strong>is_category()</strong></p>
<p>显示类别存档页面页面时，is_category()标签返回TRUE。</p>
<p><strong>is_category(&#8217;9&#8242;)</strong></p>
<p>显示类别ID为9的存档页面时，is_category(&#8217;9&#8242;)标签返回TRUE。</p>
<p><strong>is_category(&#8216;Stinky Cheeses&#8217;) </strong></p>
<p>显示雷冰名称为“Stinky Cheeses”的存档页面时，is_category(&#8216;Stinky Cheeses&#8217;)标签返回TRUE。</p>
<p><strong>is_category(&#8216;blue-cheese&#8217;) </strong></p>
<p>显示类别别名为&quot;blue-cheese&quot;的存档页面时，is_category(&#8216;blue-cheese&#8217;) 标签返回TRUE。</p>
<p><strong>is_category(array(9,&#8217;blue-cheese&#8217;,'Stinky Cheeses&#8217;)) </strong></p>
<p>当所显示的类别存档term_ID为9，或别名为&quot;blue-cheese&quot;，或类别名称为&quot;Stinky Cheeses&quot;时，is_category(array(9,&#8217;blue-cheese&#8217;,'Stinky Cheeses&#8217;)) 标签返回TRUE。注意：数组功能首次出现于WordPress 2.5。</p>
<p><strong>in_category(&#8217;5&#8242;) </strong></p>
<p>若当前日志属于某个指定ID的类别，in_category(&#8217;5&#8242;) 标签返回TRUE。</p>
<p>注意：判断条件是否符合时，请不要将“in”写作“is”，两者有很大区别。</p>
<h6><a name="is_tag">标签页面</a></h6>
<p><strong>is_tag()</strong></p>
<p>显示标签存档页面时，is_tag() 会返回TRUE。</p>
<p><strong>is_tag(&#8216;mild&#8217;) </strong></p>
<p>显示别名为“mild”的标签的存档页面时，is_tag(&#8216;mild&#8217;) 返回TRUE。</p>
<p><strong>is_tag(array(&#8216;sharp&#8217;,'mild&#8217;,'extreme&#8217;))</strong></p>
<p>若显示的标签别名为&quot;sharp&quot;、 &quot;mild&quot;或&quot;extreme&quot;，is_tag(array(&#8216;sharp&#8217;,'mild&#8217;,'extreme&#8217;)) 返回TRUE。注意：数组功能首次出现于WordPress 2.5。</p>
<p><strong>has_tag()</strong></p>
<p>若当前日志有标签，has_tag()返回TRUE。该标签必须用在<a href="http://www.wordpress.la/codex-WordPress%E4%B8%BB%E5%BE%AA%E7%8E%AF.html">WordPress主循环</a>中。注意：has_tag标签首次出现在WordPress 2.6版中。</p>
<p><strong>has_tag(&#8216;mild&#8217;) </strong></p>
<p>若当前日志标签为“mild”，as_tag(&#8216;mild&#8217;) 返回TRUE。</p>
<p><strong>has_tag(array(&#8216;sharp&#8217;,'mild&#8217;,'extreme&#8217;)) </strong></p>
<p>若当前日志标签为数组中任一个标签，has_tag(array(&#8216;sharp&#8217;,'mild&#8217;,'extreme&#8217;)) 返回TRUE。</p>
<h5>分类法页面</h5>
<dl>
<dt><tt>is_tax()</tt></dt>
<dd>显示任何分类法归档页面时，is_tax()会返回TRUE。 </dd>
<dt><tt>is_tax('mild')</tt></dt>
<dd>显示分类法归档页面别名为“mild”时，<tt>is_tax('mild')返回TRUE。</tt> </dd>
<dt><tt>is_tax(array('sharp','mild','extreme'))</tt></dt>
<dd>当前分类法归档别名为数组中的任一个&quot;sharp&quot;, &quot;mild&quot;, 或 &quot;extreme&quot;时，<tt>is_tax(array('sharp','mild','extreme'))</tt> 返回TRUE。</dd>
</dl>
<p><a name="A_Registered_Taxonomy"></a></p>
<h5>注册过的分类法</h5>
<dl>
<dt><tt>is_taxonomy()</tt></dt>
<dd>当某一种分类法通过<a href="http://codex.wordpress.org/Function_Reference/register_taxonomy">register_taxonomy()</a>注册， <tt>is_taxonomy()</tt> 返回TRUE。</dd>
</dl>
<h6><a name="is_author">作者页面</a></h6>
<p><strong>is_author() </strong></p>
<p>显示作者页面时，is_author()返回TRUE。</p>
<p><strong>is_author(&#8217;4&#8242;) </strong></p>
<p>若显示的是ID为4的作者的存档页面，is_author(&#8217;4&#8242;) 返回TRUE。</p>
<p><strong>is_author(&#8216;Vivian&#8217;) </strong></p>
<p>若显示的是用户名为“Vivian”的作者的存档页面，is_author(&#8216;Vivian&#8217;) 返回TRUE。</p>
<p><strong>is_author(&#8216;john-jones&#8217;) </strong></p>
<p>若显示的是用户名为“john-jones”的作者的存档页面，is_author(&#8216;john-jones&#8217;) 返回TRUE。</p>
<p><strong>is_author(array(4,&#8217;john-jones&#8217;,'Vivian&#8217;)) </strong></p>
<p>若页面的用户名ID为4，或user_nicename为“john-jones”，或用户名为“Vivian”，is_author(array(4,&#8217;john-jones&#8217;,'Vivian&#8217;)) 返回TRUE。注意：数组功能首次出现于WordPress 2.5。</p>
<h6><a name="is_date">日期页面</a></h6>
<p><strong>is_date()</strong></p>
<p>显示日期相关的存档页面（如月存档，年存档，日存档等基于时间的存档页面）时，is_date() 返回TRUE。</p>
<p><strong>is_year() </strong></p>
<p>显示年存档信息时，is_year() 返回TRUE。</p>
<p><strong>is_month()</strong></p>
<p>显示月存档信息时，is_month() 返回TRUE。</p>
<p><strong>is_day() </strong></p>
<p>显示日存档信息时，is_day() 返回TRUE。</p>
<p><strong>is_time() </strong></p>
<p>显示某时、某分或某秒的存档信息时，is_time() 返回TRUE。</p>
<h6><a name="is_archive">存档页面</a></h6>
<p><strong>is_archive() </strong></p>
<p>无论显示何种存档页面时，is_archive() 都会返回TRUE。类别存档、标签存档、作者存档以及日期存档页面都属于存档页面。</p>
<h6>搜索结果页面</h6>
<p><strong>is_search() </strong></p>
<p>显示搜索结果页面时，is_search() 返回TRUE。</p>
<h6><a name="is_404">404 Not Found页面</a></h6>
<p><strong>is_404() </strong></p>
<p>出现&quot;HTTP 404: Not Found&quot;错误后所显示的页面。</p>
<h6><a name="is_paged">分页型页面</a></h6>
<p><strong>is_paged()</strong></p>
<p>当前页面需要分页显示时，is_paged()返回TRUE。分页型页面是指某个存档页面或需要分成若干页显示的主页，显示第二页以及之后页面时，is_paged()返回TRUE。有些日志或<a href="http://www.wordpress.la/codex-%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8.html">页面</a>使用&lt;!&#8211;nextpage&#8211;&gt;快速标签分页显示其内容，这些日志和<a href="http://www.wordpress.la/codex-%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8.html">页面</a>都不属于分页型页面。</p>
<h6><a name="is_attachment">附件</a></h6>
<p><strong>is_attachment() </strong></p>
<p>显示某篇日志或<a href="http://www.wordpress.la/codex-%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BD%BF%E7%94%A8.html">页面</a>的附件文件时，is_attachment() 会返回TRUE。附件可以是一张图片，也可以是用户所上传的其它文件。附件能够显示在“页面”或模板上。更多信息请参阅“<a href="http://wordpress.la/codex-%E5%9B%BE%E7%89%87%E5%92%8C%E9%99%84%E4%BB%B6%E7%9A%84%E4%BD%BF%E7%94%A8.html">图片和附件的使用</a>”。</p>
<h6>独立页面、单篇日志或附件</h6>
<p><strong>is_singular()</strong></p>
<p>当is_single(), is_page() 或is_attachment()返回TRUE时，is_singular() 也返回TRUE。</p>
<h6>新闻聚合器</h6>
<p><strong>is_feed()</strong></p>
<p>网站需要使用RSS订阅时，is_feed()返回TRUE。一般情况下会用到is_feed()标签的是WordPress系统和插件开发人员，普通WordPress用户很少用到is_feed()标签。</p>
<h6>引用通告（Trackback）</h6>
<p><strong>is_trackback() </strong></p>
<p>网站需要将WordPress钩子勾入Trackback。一般情况下会用到这个标签的是WordPress系统和插件开发人员，普通WordPress用户很少用到is_feed()标签。</p>
<h6>预览</h6>
<p><strong>is_preview() </strong></p>
<p>若目前页面是在草稿状态下显示的（即预览），is_preview() 返回TRUE。</p>
<h6>Has An Excerpt （摘要）</h6>
<p><strong>as_excerpt() </strong></p>
<p>当前日志要显示摘要时，as_excerpt() 返回TRUE。</p>
<p><strong>has_excerpt(&#8217;42&#8242;) </strong></p>
<p>若ID为42的日志要显示摘要时，has_excerpt(&#8217;42&#8242;) 返回TRUE。</p>
<pre>&lt;?php
// Get $post if you're inside a function
global $post;

if ( empty($post-&gt;post_excerpt) ) {
    // This post has no excerpt
} else {
    // This post has excerpt
}
?&gt;</pre>
<h6>Inside The Loop （在WordPress主循环中）</h6>
<p><strong>in_the_loop() </strong></p>
<p>判断目前是否在WordPress主循环中。该标签适用于插件开发人员，若目前在WordPress主循环中，该标签返回TRUE。</p>
<h6>Is Sidebar Active（侧边栏是否被激活）</h6>
<p><strong>is_active_sidebar() </strong></p>
<p>检查现有侧边栏是否被激活（是否启用）。若侧边栏被启用，is_active_sidebar() 返回TRUE，否则返回FALSE。该条件函数引入于WordPress 2.8版。</p>
<h5>实例</h5>
<p>下面是一些对条件标签的实际应用。</p>
<h6>单篇日志</h6>
<p>下面这个例子向我们展示了怎样用is_single()为某个单独日志页面显示独特内容：</p>
<pre>if (is_single())
{
     echo 'This is just one of many fabulous entries in the ' . single_cat_title() . '
category!';
}</pre>
<h6>区分基于日期的页面</h6>
<p>如果访问者按日期浏览网站，我们可以用不同颜色标注不同年份的日志或其它信息：</p>
<pre>&lt;?php
// this starts The Loop
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;
&lt;h2 id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;
&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php
the_title(); ?&gt;&quot;&gt;
&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;small&gt;&lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt;&lt;/small&gt;

&lt;?php
// are we showing a date-based archive?
if (is_date())

{
     if (date('Y') != get_the_date('Y'))
     {
          // this post was written in a previous year
          // so let's style the content using the &quot;oldentry&quot; class
          echo '&lt;div class=&quot;oldentry&quot;&gt;';
     } else {
          echo '&lt;div class=&quot;entry&quot;&gt;';
     }
} else {
     echo '&lt;div class=&quot;entry&quot;&gt;';
}
the_content('Read the rest of this entry »');
?&gt;
&lt;/div&gt;</pre>
<h6>可视化的侧边栏内容</h6>
<p>本例根据访问者当前浏览的界面，在侧边栏上显示不同内容。</p>
<pre>&lt;!-- begin sidebar --&gt;
&lt;div id=&quot;sidebar&quot;&gt;
&lt;?php
// let's generate info appropriate to the page being displayed
if (is_home()) {
        // we're on the home page, so let's show a list of all top-level categories
        echo &quot;&lt;ul&gt;&quot;;
        wp_list_cats('optionall=0&amp;sort_column=name&amp;list=1&amp;children=0');
        echo &quot;&lt;/ul&gt;&quot;;
} elseif (is_category()) {
        // we're looking at a single category view, so let's show _all_ the categories
         echo &quot;&lt;ul&gt;&quot;;
        wp_list_cats('optionall=1&amp;sort_column=name&amp;list=1&amp;children=1&amp;hierarchical=1');
        echo &quot;&lt;/ul&gt;&quot;;
} elseif (is_single()) {
        // we're looking at a single page, so let's not show anything in the sidebar
} elseif (is_page()) {
        // we're looking at a static page.  Which one?
        if (is_page('About')) {
             // our about page.
             echo &quot;&lt;p&gt;This is my about page!&lt;/p&gt;&quot;;
        } elseif (is_page('Colophon')) {
             echo &quot;&lt;p&gt;This is my colophon page, running on WordPress &quot; . bloginfo('version') . &quot;&lt;/p&gt;&quot;;
        } else {
              // catch-all for other pages
              echo &quot;&lt;p&gt;Vote for Pedro!&lt;/p&gt;&quot;;
        }
} else {
        // catch-all for everything else (archives, searches, 404s, etc)
        echo &quot;&lt;p&gt;Pedro offers you his protection.&lt;/p&gt;&quot;;
} // That's all, folks!
?&gt;
&lt;form id=&quot;searchform&quot; method=&quot;get&quot; action=&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;&quot;&gt;
&lt;div&gt;
&lt;input type=&quot;text&quot; name=&quot;s&quot; id=&quot;s&quot; size=&quot;15&quot; /&gt;
&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Search'); ?&gt;&quot; /&gt;
&lt;/div&gt;
&lt;/form&gt;

&lt;/div&gt;
&lt;!-- end sidebar --&gt;</pre>
<h6>404页面</h6>
<p><a href="http://www.wordpress.la/codex-%E4%BC%98%E5%8C%96Error%20404%E9%A1%B5%E9%9D%A2.html">设计Error 404页面</a>中的<a href="http://www.wordpress.la/codex-%E4%BC%98%E5%8C%96Error%20404%E9%A1%B5%E9%9D%A2.html#friendly">编写友好的错误信息</a>部分有一个使用PHP条件函数isset()的示例。</p>
<h6>动态菜单高亮</h6>
<p><a href="http://www.wordpress.la/codex-%E9%AB%98%E4%BA%AE%E6%98%BE%E7%A4%BA%E5%8A%A8%E6%80%81%E8%8F%9C%E5%8D%95.html">动态菜单高亮</a>中介绍了如何用条件标签在菜单中激活当前页面的高亮显示部分。</p>
<h6>在主题的footer.php文件中</h6>
<p>有时在模板文件（如sidebar.php）中执行的查询可能破坏一些条件标签。例如，某个条件标签可以在header.php文件中正常运行，但却不能适应主题的footer.php文件。这时可以在页脚中把wp_reset_query放条件检验前：</p>
<pre>&lt;?php
wp_reset_query();
if (is_page('2') ) {
echo 'this is page 2!';
}
?&gt;</pre>
<h5>条件标签索引</h5>
<p>按字母顺序排列：</p>
<ul>
<li>comments_open </li>
<li>has_tag </li>
<li>in_category </li>
<li>is_404 </li>
<li>is_admin </li>
<li>is_archive </li>
<li>is_attachment </li>
<li>is_author </li>
<li>is_category </li>
<li>is_comments_popup </li>
<li>is_date </li>
<li>is_day </li>
<li>is_feed </li>
<li>is_front_page </li>
<li>is_home </li>
<li>is_month </li>
<li>is_page </li>
<li>is_page_template </li>
<li>is_paged </li>
<li>is_preview </li>
<li>is_search </li>
<li>is_single </li>
<li>is_singular </li>
<li>is_sticky </li>
<li>is_tag </li>
<li>is_time </li>
<li>is_trackback </li>
<li>is_year </li>
<li>pings_open</li>
</ul>
<h5>常用函数</h5>
<p>转载自：<a href="http://www.wordpress.la/codex-%E6%9D%A1%E4%BB%B6%E6%A0%87%E7%AD%BE.html" target="_blank">WordPress啦</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/wordpress%e6%9d%a1%e4%bb%b6%e6%a0%87%e7%ad%be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress主题中的判断函数</title>
		<link>http://ict.tigerrr.cn/wordpress%e4%b8%bb%e9%a2%98%e4%b8%ad%e7%9a%84%e5%88%a4%e6%96%ad%e5%87%bd%e6%95%b0/</link>
		<comments>http://ict.tigerrr.cn/wordpress%e4%b8%bb%e9%a2%98%e4%b8%ad%e7%9a%84%e5%88%a4%e6%96%ad%e5%87%bd%e6%95%b0/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 18:06:49 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[wordpress开发]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[函数]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/wordpress%e4%b8%bb%e9%a2%98%e4%b8%ad%e7%9a%84%e5%88%a4%e6%96%ad%e5%87%bd%e6%95%b0/</guid>
		<description><![CDATA[WordPress有很多判断函数，显示出你想要的内容，在主题制作过程中，通过这些函数你可以定制出功能强大而又时尚的主题。<a name="entrymore"></a>    文章显示判断函数    is_single()    判断是否是具体文章的页面    is_single(’2′)    判[......]<p class='read-more'><a href='http://ict.tigerrr.cn/wordpress%e4%b8%bb%e9%a2%98%e4%b8%ad%e7%9a%84%e5%88%a4%e6%96%ad%e5%87%bd%e6%95%b0/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>WordPress有很多判断函数，显示出你想要的内容，在主题制作过程中，通过这些函数你可以定制出功能强大而又时尚的主题。<a name="entrymore"></a>    <br />文章显示判断函数    <br />is_single()    <br />判断是否是具体文章的页面    <br />is_single(’2′)    <br />判断是否是具体文章（id=2）的页面    <br />is_single(’Beef Stew’)    <br />判断是否是具体文章（标题判断）的页面    <br />is_single(’beef-stew’)    <br />判断是否是具体文章（slug判断）的页面    <br />comments_open()    <br />是否留言开启    <br />pings_open()    <br />是否开启ping    <br />页面显示判断函数    <br />is_page()    <br />是否是页面    <br />is_page(’42′)    <br />id判断，即是否是id为42的页面    <br />is_page(’About Me’)    <br />判断标题    <br />is_page(’about-me’)    <br />slug判断    <br />分类显示判断函数    <br />is_category()    <br />是否是分类    <br />is_category(’6′)    <br />id判断，即是否是id为6的分类    <br />is_category(’Cheeses’)    <br />分类title判断    <br />is_category(’cheeses’)    <br />分类 slug判断    <br />in_category(’5′)    <br />判断当前的文章是否属于分类5    <br />作者归档显示判断函数    <br />is_author()    <br />将所有的作者的页面显示出来    <br />is_author(’1337′)    <br />显示author number为1337的页面    <br />is_author(’Elite Hacker’)    <br />通过昵称来显示当前作者的页面    <br />is_author(’elite-hacker’)    <br />下面是通过不同的判断实现以年、月、日、时间等方式来显示归档    <br />时间归档显示判断函数    <br />is_date()    <br />is_year()    <br />is_month()    <br />is_day()    <br />is_time()    <br />判断当前是否是归档页面    <br />is_archive()    <br />判断是否是搜索    <br />is_search()    <br />判断页面是否404    <br />is_404()    <br />判断是否翻页    <br />比如你当前的blog是http://domain.com 显示http://domain.com?paged=2的时候，这个判断将返回真，通过这个函数可以配合is_home来控制某些只能在首页显示的界面，    <br />例如：if(is_home() &amp;&amp; !is_paged() )    <br />is_paged()    <br />其他显示判断函数    <br />is_attachment()    <br />is_feed()    <br />is_trackback()</p>
<p><a href="http://www.wucailiang.com/WordPress-hanshu/">http://www.wucailiang.com/WordPress-hanshu/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/wordpress%e4%b8%bb%e9%a2%98%e4%b8%ad%e7%9a%84%e5%88%a4%e6%96%ad%e5%87%bd%e6%95%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPMailer 发邮件时标题、内容以及发信人收信人称谓等乱码问题解决</title>
		<link>http://ict.tigerrr.cn/phpmailer-%e5%8f%91%e9%82%ae%e4%bb%b6%e6%97%b6%e6%a0%87%e9%a2%98%e3%80%81%e5%86%85%e5%ae%b9%e4%bb%a5%e5%8f%8a%e5%8f%91%e4%bf%a1%e4%ba%ba%e6%94%b6%e4%bf%a1%e4%ba%ba%e7%a7%b0%e8%b0%93%e7%ad%89%e4%b9%b1/</link>
		<comments>http://ict.tigerrr.cn/phpmailer-%e5%8f%91%e9%82%ae%e4%bb%b6%e6%97%b6%e6%a0%87%e9%a2%98%e3%80%81%e5%86%85%e5%ae%b9%e4%bb%a5%e5%8f%8a%e5%8f%91%e4%bf%a1%e4%ba%ba%e6%94%b6%e4%bf%a1%e4%ba%ba%e7%a7%b0%e8%b0%93%e7%ad%89%e4%b9%b1/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 19:11:32 +0000</pubDate>
		<dc:creator>tiger</dc:creator>
				<category><![CDATA[php开源程序]]></category>
		<category><![CDATA[phpmailer]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://ict.tigerrr.cn/phpmailer-%e5%8f%91%e9%82%ae%e4%bb%b6%e6%97%b6%e6%a0%87%e9%a2%98%e3%80%81%e5%86%85%e5%ae%b9%e4%bb%a5%e5%8f%8a%e5%8f%91%e4%bf%a1%e4%ba%ba%e6%94%b6%e4%bf%a1%e4%ba%ba%e7%a7%b0%e8%b0%93%e7%ad%89%e4%b9%b1/</guid>
		<description><![CDATA[对于内容，在发邮件时设置一下字符集即可：$mail-&#62;CharSet = &#8220;UTF-8&#8243;；
对于标题，发信人收信人称谓等等：可以先用函数base64_encode() — 使用 MIME base64 对数据进行编码；标题字符串前加编码类型例如<strong>：=?UT[......]</strong><p class='read-more'><a href='http://ict.tigerrr.cn/phpmailer-%e5%8f%91%e9%82%ae%e4%bb%b6%e6%97%b6%e6%a0%87%e9%a2%98%e3%80%81%e5%86%85%e5%ae%b9%e4%bb%a5%e5%8f%8a%e5%8f%91%e4%bf%a1%e4%ba%ba%e6%94%b6%e4%bf%a1%e4%ba%ba%e7%a7%b0%e8%b0%93%e7%ad%89%e4%b9%b1/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>对于内容，在发邮件时设置一下字符集即可：<br />$mail-&gt;CharSet = &#8220;UTF-8&#8243;；</p>
<p>对于标题，发信人收信人称谓等等：<br />可以先用函数base64_encode() — 使用 MIME base64 对数据进行编码；<br />标题字符串前加编码类型例如<strong>：=?UTF-8?B?</strong>；标题字符串后加：<strong>?=</strong><br />具体而言，将此类文本数据放到下面粗体的$subject的位置，然后就不会乱码了：<br />=?utf-8?B?&#8221; . base64_encode(<strong>$subject</strong>) . &#8220;?=</p>
]]></content:encoded>
			<wfw:commentRss>http://ict.tigerrr.cn/phpmailer-%e5%8f%91%e9%82%ae%e4%bb%b6%e6%97%b6%e6%a0%87%e9%a2%98%e3%80%81%e5%86%85%e5%ae%b9%e4%bb%a5%e5%8f%8a%e5%8f%91%e4%bf%a1%e4%ba%ba%e6%94%b6%e4%bf%a1%e4%ba%ba%e7%a7%b0%e8%b0%93%e7%ad%89%e4%b9%b1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
