<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[阿Tim日志]]></title> 
<link>https://atim.cn/index.php</link> 
<description><![CDATA[专业的php开发者.开发团队的带队人]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[阿Tim日志]]></copyright>
<item>
<link>https://atim.cn/iptables-config/</link>
<title><![CDATA[iptables 实例用法及配置手册]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[软件应用]]></category>
<pubDate>Thu, 22 Dec 2011 06:51:33 +0000</pubDate> 
<guid>https://atim.cn/iptables-config/</guid> 
<description>
<![CDATA[ 
	1、查看防火墙状态<br/><br/>[root@localhost ~]# service iptables status<回车> <br/><a href="https://atim.cn/attachment.php?fid=33" target="_blank"><img src="https://atim.cn/attachment.php?fid=33" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>2、编辑/etc/sysconfig/iptables文件。我们实例中要打开8080端口和9990端口<br/>终端上输入 vim /etc/sysconfig/iptables <br/>可能 /etc/sysconfig/iptables 会不存在.自己创建也可以<br/><a href="https://atim.cn/attachment.php?fid=34" target="_blank"><img src="https://atim.cn/attachment.php?fid=34" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>3、依葫芦画瓢，我们添加8080端口和9990端口<br/><a href="https://atim.cn/attachment.php?fid=35" target="_blank"><img src="https://atim.cn/attachment.php?fid=35" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>4、保存/etc/sysconfig/iptables文件，并在终端执行<br/>[root@localhost ~]# service iptables restart <回车><br/><a href="https://atim.cn/attachment.php?fid=36" target="_blank"><img src="https://atim.cn/attachment.php?fid=36" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>5、从新查看防火墙状态<br/>[root@localhost ~]# service iptables status<回车><br/><a href="https://atim.cn/attachment.php?fid=37" target="_blank"><img src="https://atim.cn/attachment.php?fid=37" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>6、这时候，服务器的8080和9990端口就可以对外提供服务了。<br/><br/>7、其他端口的开放模式就是类似如此开放模式。<br/><br/>附上iptables的手册<br/><a href="attachment.php?fid=32">点击这里下载文件</a><br/>上面例子的代码<br/><div class="code"><br/>*filter<br/>:INPUT ACCEPT &#91;0:0&#93;<br/>:FORWARD ACCEPT &#91;0:0&#93;<br/>:OUTPUT ACCEPT &#91;0:0&#93;<br/>-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<br/>-A INPUT -p icmp -j ACCEPT<br/>-A INPUT -i lo -j ACCEPT<br/>-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT<br/>-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT<br/>-A INPUT -j REJECT --reject-with icmp-host-prohibited<br/>-A FORWARD -j REJECT --reject-with icmp-host-prohibited<br/>-P INPUT DROP <br/>COMMIT<br/></div><br/>Tags - <a href="https://atim.cn/tags/iptables/" rel="tag">iptables</a> , <a href="https://atim.cn/tags/linux/" rel="tag">linux</a> , <a href="https://atim.cn/tags/%25E9%2585%258D%25E7%25BD%25AE/" rel="tag">配置</a>
]]>
</description>
</item><item>
<link>https://atim.cn/iptables-config/#blogcomment</link>
<title><![CDATA[[评论] iptables 实例用法及配置手册]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://atim.cn/iptables-config/#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>