WCCP with Cisco 877 and Squid
Tuesday, March 17th, 2009 by SteveI just upgraded my Cisco 877 to the latest 12.4(24)T IOS, so I thought I’d have another go at getting WCCP to work. Good news: it works!
Here’s my working configuration on the Cisco 877:
ip cef
ip wccp web-cacheinterface Vlan1
ip wccp web-cache redirect in
This tells the router that web traffic coming into the Vlan1 interface is a candidate for caching. With WCCP, web-caches register themselves with the router, then the router forwards requests to them. This means that if the cache disappears, the router will forward web requests directly to the internet.
I’m using Debian, so I added this to /etc/network/interfaces (replace 1.2.3.4 with the router identifier shown on the cisco by “show ip wccp”. In my case this is the external internet-facing IP address):
auto gre1
iface gre1 inet static
address 127.0.0.2
netmask 255.255.255.255
pre-up ip tunnel add gre1 mode gre remote 1.2.3.4 local 10.0.20.1 dev eth1
post-down ip tunnel del gre1
And I added this line to my firewall script. You could add it to rc.local if you don’t have anywhere else to put it:
iptables -t nat -A PREROUTING -i gre1 -d 0/0 -p tcp –dport 80 -j DNAT –to-destination 10.0.20.1:3128
The only thing left now is the squid configuration. I specified the internal address of the cisco 877 here (10.0.20.254):
wccp2_router 10.0.20.254
wccp2_rebuild_wait on
wccp2_forwarding_method 1
wccp2_return_method 1
wccp2_assignment_method 1
wccp2_service standard 0
wccp2_address 10.0.20.1
Useful links: