⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 squid透明代理的安装及使用方法.txt

📁 LINUX下的安装声卡等操作和技巧介绍
💻 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 + -