2、透明代理服務器的配置
一臺linux web服務器(單網卡)
一臺真機器XP
實驗步驟:
一:IP地址規劃
linux代理服務器:內網:192.168.1.100(eth0)
外網:192.168.2.88(eth1)
Linux web服務器:iP:192.168.2.101
xp ip:192.168.1.88
二:安裝好Web服務器,並測試啓動成功。
三:安裝squid軟件包
四:配置普通代理實驗,並在xp真 機器上測試是否可以通過代理訪問web服務器(不要配置網關,ping不通web服務器卻能正常訪問web頁面才正常)
cache_dir ufs /var/spool/squid 100 16 256
cache_mgr [email][email protected][/email]
cache_effective_user squid
cache_effective_group squid
http_access all all
squid -z
hostname [url]www.abc.com[/url]
vi /etc/hosts
192.168.1.100 [url]www.abc.com[/url] www
#/bin/bash
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
service iptables restart
echo "1" >/proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -s 192.168.1.0/24 -t tcp --dport -j REDIRECT 3128
iptables -t nat -A POSTROUTing -s 192.168.1.0/24 eth1 -j
#iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth1 - 192.168.2.88
---------------------------------------------------------------------------
squid.sh
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
service squid reload