Squid Web Cache Wiki

Squid Web Cache 文档

🔗 使用 WCCPv2 拦截配置 Cisco 3640

🔗 目录

这是在一台运行 c3640-is-mz.122-23f.bin 的 Cisco 3640 上完成的;它充当 NAT 网关和家庭路由器。

此配置将 Web 流量(仅限端口 80)通过 WCCPv2 传递到另一台设备进行处理。预计该设备将包含 Squid 或其他代理来处理流量。

🔗 Cisco 3640 路由器

!
ip wccp web-cache
!
interface Ethernet1/0
 description Public interface
 ip address X.X.X.X 255.255.255.248
 no ip redirects
 no ip unreachables
 ip nat outside
 full-duplex
!
interface FastEthernet2/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet2/0.1
 encapsulation dot1Q 1 native
 ip address 192.168.1.1 255.255.255.0
 no ip redirects
 no ip unreachables
 ip wccp web-cache redirect in
 ip nat inside

🔗 Squid WCCP 版本 2 配置

所有以 wccp2_* 开头的 squid.conf 选项仅适用于 **WCCPv2**

🔗 Squid 配置

🔗 Squid 设备操作系统配置

modprobe ip_gre
ip tunnel add wccp0 mode gre remote $ASA-EXT-IP local $SQUID-IP dev eth0

ifconfig wccp0 $SQUID-IP netmask 255.255.255.255 up

禁用 rp_filter,否则数据包将被静默丢弃

echo 0 >/proc/sys/net/ipv4/conf/wccp0/rp_filter
echo 0 >/proc/sys/net/ipv4/conf/eth0/rp_filter

启用 ip-forwarding 并将数据包重定向到 squid

echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -i wccp0 -p tcp --dport 80 -j REDIRECT --to-port 3129
iptables -t nat -A POSTROUTING -j MASQUERADE

🔗 故障排除


⚠️ Disclaimer: Any example presented here is provided "as-is" with no support
or guarantee of suitability. If you have any further questions about
these examples please email the squid-users mailing list.

类别: ConfigExample

导航:站点搜索站点页面分类🔼 向上