<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[如何用Linux做代理服务器（最简单的做法，这里以RedHat9.0为例）]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[服务器技术]]></category>
<pubDate>Sat, 11 Nov 2006 07:49:52 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	需要配置:<br/>CPU: Pentium 133 Mhz<br/>内存: 32 MB<br/>硬盘:640 MB<br/>网卡:2块<br/><br/>1.安装Linux,选择最小安装，把组件的勾全部去掉,除了配置一下IP,其它全部默认 安装好后进入提示符<br/><br/>2.首先配置网卡,如果用图形界面配置完成后检查一下IP是否正确<br/> &nbsp;ifconfig eth0 &nbsp; #检查网卡0的状态,如果想更改配置文件(命令:vi /etc/sysconfig/network-scripts/ifcfg-eth0) 文件<br/> &nbsp;ifconfig eth1 &nbsp; #检查网卡1的状态,如果想更改配置文件(命令:vi /etc/sysconfig/network-scripts/ifcfg-eth1) 文件<br/> &nbsp;route &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #检查网关,想更改则用(命令:vi /etc/sysconfig/network)在这里的GATEWAY=后面填加想更改的网关就可以<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #用route检查路由的状态,如果读出来很顺利则说明没问题,用PING检测一下内网和外网是否能PING通<br/><br/>3.用IPTABLES 实现双网卡NAT功能,从而实现代理服务器上网<br/> &nbsp;vi /etc/sysconfig/network &nbsp; #首先,编辑这个文件,在文件末尾加上一行( FORWARD_IPV4=yes )只有打开IP中转功能才可以实现NAT<br/> &nbsp; &nbsp; &nbsp; &nbsp; FORWARD_IPV4=yes<br/> &nbsp;vi /etc/rc.d/rc.local &nbsp; &nbsp; &nbsp; &nbsp; #编辑起动批处理文件,在文件末尾添加如下几行 #号为Linux注释语句不用添<br/> &nbsp; &nbsp; &nbsp; &nbsp; iptables -F &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#清除iptables表<br/> &nbsp; &nbsp; &nbsp; &nbsp; iptables -F -t nat &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #清除iptables IP nat表<br/> &nbsp; &nbsp; &nbsp; &nbsp; iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/16 -j MASQUERADE &nbsp; #添加新的IPnat表,192.168.0.0/16为局域网IP<br/> &nbsp; &nbsp; &nbsp; &nbsp; echo l>/proc/sys/net/ipv4/ip_forward &nbsp; #启动ip中转功能，至此，重启机器后代理服务器就应该好像差不多可能凑和用了<br/><br/>4.配置系统启动时加载的服务<br/> &nbsp;ntsysv &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #然后出现一个对话框,只留下iptables服务和networks服务,其它服务的勾全部去掉<br/> &nbsp;vi /etc/grub.conf &nbsp; &nbsp;#如果系统起动时出现一个10秒等待时间对话框,则在这里设置等待时间<br/><br/>Tags - <a href="http://www.dzhope.com/tags/%25E4%25BB%25A3%25E7%2590%2586%25E6%259C%258D%25E5%258A%25A1%25E5%2599%25A8/" rel="tag">代理服务器</a>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] 如何用Linux做代理服务器（最简单的做法，这里以RedHat9.0为例）]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>