squid 代理服務器的配置實驗

squid 代理服務器的配置實驗
實驗目的:1、普通代理服務器的配置
        2、透明代理服務器的配置
實驗環境:一臺linux代理服務器(雙網卡)
   一臺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頁面才正常)
五:配置透明式代理實驗,並在xp真機器上測試不在IE瀏覽裏指定代理是否可以訪問web服務器,(xp真機器要配置網關,並且linux代理服務器上要些好防火牆腳本)

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
vi ip.sh
#/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
# cat squid.sh >> /etc/squid/squid.conf
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章