?? squid透明代理的安裝及使用方法.txt
字號:
作者:xiaozhou
email: fsswyjz@21cn.com
日期:2001-4-1 18:30:41
我原來在Linux上成功配置過使用Squid做透明代理,但是,當時未做任何記錄。
最近經常有網友問及Squid的透明代理使用方法,故又重新整理了一下,由于沒有
條件做實驗,可能會有不完整的地方,望見諒。有問題的話,請通知我;如果你
按本文的方法做成了,也請通知我一聲,謝謝!以下方法使用的內核為2.2。
第一步: 你需要使用以下選項重新編譯內核,源文如下:
You need to configure your kernel for ipchains. Configuring Linux
kernels is beyond the scope of this FAQ. One way to do it is:
# cd /usr/src/linux
# make menuconfig
The following shows important kernel features to include:
[*] Network firewalls
[ ] Socket Filtering
[*] Unix domain sockets
[*] TCP/IP networking
[ ] IP: multicasting
[ ] IP: advanced router
[ ] IP: kernel level autoconfiguration
[*] IP: firewalling
[ ] IP: firewall packet netlink device
[*] IP: always defragment (required for masquerading)
[*] IP: transparent proxy support
You must include the IP: always defragment, otherwise it prevents
you from using the REDIRECT chain.
第二步:到http://www.squid-cache.org/下載Squid的源程序,加入以下參數重新編譯(你
可能根據需要,還需要別的參數)
./configure --enable-ipf-transparent
第三步:配置squid.conf,以下是一些比較重要的參數:
http_port 8080
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
第四步: 你需要使用Ipchains配置使用Squid,例如:Squid使用的端口為8080,
本地局域網的IP地址段為:192.168.1.0/24,則使用如下命令:
ipchains -A input -j REDIRECT 8080 -p tcp -s 192.168.1.0/24 -d 0.0.0.0/0 80
第五步:客戶端設置:由于使用透明代理,故客戶端的設置非常簡單,只需設置網關,
使其指向該Linux機器即可,IE等瀏覽器無需設置代理服務器。如果你使用DHCP進
行IP地址分配,則配置更簡單,至于如何設置,這里就不說了,請參考相關文章。
(注:原文參見:http://www.squid-cache.org/Doc/FAQ/FAQ-17.html)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -