🔗 使用 WCCPv2 拦截配置 Cisco IOS 12.4(6) T2
- 作者: Reuben Farrelly
🔗 目录
此配置会将 Web 流量(仅限 80 端口)通过 WCCPv2 传递到另一台设备进行处理。预期该设备将包含 Squid 或其他代理来处理流量。
路由器运行的是 cisco IOS 12.4(6)T2 ADVSECURITY,我的 FastEthernet 端口上有一个子接口,因为交换机-路由器链路是一个 trunk。
🔗 Cisco IOS 12.4(6) T2 路由器
!
ip wccp web-cache
ip cef
!
interface FastEthernet0/0.2
description Link to internal LAN
encapsulation dot1Q 2
ip address 192.168.0.1 255.255.255.0
ip access-group outboundfilters in
no ip proxy-arp
ip wccp web-cache redirect in
ip inspect fw-rules in
ip nat inside
ip virtual-reassembly
no snmp trap link-status
!
🔗 Squid WCCP 版本 2 配置
所有以 wccp2_* 开头的 squid.conf 选项仅适用于 **WCCPv2**
- wccp2_router
- wccp2_address
- wccp2_forwarding_method
- wccp2_return_method
- wccp2_assignment_method
- wccp2_service
🔗 Squid 配置
$IP-OF-ROUTER 在下面用于表示将 WCCP 流量发送到 Squid 的路由器的 IP 地址。
http_port 3129 intercept
wccp2_router $IP-OF-ROUTER
wccp2_forwarding_method gre
wccp2_return_method gre
wccp2_service standard 0 password=foo
🔗 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
🔗 故障排除
🔗 IOS 12.4 (6)-(9) T 丢弃数据包
在我运行的此版本的 IOS 软件(12.4(6)T2 和 12.4(9)T)中,您**绝对不能**在与您的 ip wccp web-cache redirect 语句相同的接口上开启 ip inspect fw-rules。
我就此问题打开了一个 TAC 案例,因为这显然是一个 bug,并且与之前 WCCP 在同一接口上配置 IP 检查时运行良好的情况相比是回归。这已被确认为 IOS 中的一个 bug,记录在 CSCse55959 中。
导致此问题的原因是 IP 检查进程丢弃了 TCP 流量分片——而这些分片根本就不应该被检查。此 bug 不会在 PIX 上发生,PIX 在相同的网络设计和配置下运行正常。如果您希望此 bug 被修复,请打开一个 Cisco TAC 案例,引用此 bug 报告并鼓励 Cisco 修复它。
⚠️ 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
导航:站点搜索、站点页面、分类、🔼 向上