From: Sinyuk Roman <roman@univ.kiev.ua.>
Date: Mon, 20 Jan 2005 18:21:07 +0000 (UTC)
Subject: WCCPv2 для squid на FreeBSD (eng)
Оригинал: http://www.univ.kiev.ua/~roman/wccpv2/
WCCPv2 for squid on FreeBSD howto
Requirements:
* Tested on FreeBSD 4.8R and FreeBSD-Stable.
* Squid-2.5.STABLE4
* Cisco IOS with wccp support (ip plus or enterprise plus)
Note: WCCPv1 and WCCPv2 have different encapsulation formats, and are
not compatible. GRE frames with WCCPv2 encapsulated packets has extra
4 bytes in GRE header, and kernel code modification required.
* Step 1. Modify /usr/src/sys/net/if_gre.h. Add in to struct gre_h 4
bytes field:
struct gre_h {
u_int16_t flags; /* GRE flags */
u_int16_t ptype; /* protocol type of payload typically
Ether protocol type*/
u_int32_t xxx; /* Add it for WCCPv2 support */
...
* Step 2. Add "pseudo-device gre" to kernel configuration file,
recompile kernel and reboot computer
# cd /usr/src/sys/i386/conf
# vi KERNEL_CONF
# config -r KERNEL_CONF
# cd ../../compile/KERNEL_CONF
# make depend
# make
# make install
# shutdown -r now
* Step 3.a For installing squid from sources apply wccpv2 patch
(modified version of Visolve patch) to squid sources before
building:
# fetch http://www.univ.kiev.ua/~roman/wccpv2/wccpv2.patch
# tar -xzvf squid-2.5.STABLE4.tar.gz
# cd squid-2.5.STABLE4
# patch -p1 < ../wccpv2.patch
# ./configure --enable-wccpv2 ...
# make
# make install
* Step 3.b For building squid from FreeBSD port (autoconf-2.* and
automake-1.5* must be installed before):
# fetch http://www.univ.kiev.ua/~roman/wccpv2/squid-2.5-wccpv2.tar.gz
# tar -xzvf squid-2.5-wccpv2.tar.gz
# cd squid-2.5-wccpv2
If you want to install squid with other then default prefix define PREFIX va
riable:
# export PREFIX=/usr/local/squid
Add extra CONFIGURE_ARGS in Makefile.local (for example delay-pools, cache-d
igests, ...)
where:
router_IP is IP address of routers physical interface (not
loopback interface)
* Step 7. Configure Cisco router
# configure terminal
# ip wccp 97 password abc123
# interface loopback 0
# ip address 192.168.0.1 255.255.255.255
# interface Serial 0
# ip wccp 97 redirect out
# end
where:
97 is wccp2_service_id parameter and abc123 is wccp2_password,
both defined in squid.conf
Interface loopback IP used by WCCPv2 as router-id.
Interface Serial 0 is external interface.
* Step 8. Configure IPFW
# ipfw add fwd 127.0.0.1,3128 ip from any to any via gre0 in
# ipfw add permit ip from any to any
* Step 9. Configure squid. Edit squid.conf file and set:
/*
* Define this to include code which lets you specify access control
diff -Nur squid-2.5.STABLE4/src/Makefile.in squid-2.5.STABLE4_wccpv2/src/Makefile.in
--- squid-2.5.STABLE4/src/Makefile.in Wed Feb 12 04:03:14 2003
+++ squid-2.5.STABLE4_wccpv2/src/Makefile.in Sun Jan 25 04:31:20 2004
@@ -131,6 +131,9 @@
@USE_DELAY_POOLS_TRUE@DELAY_POOL_SOURCE = delay_pools.c
@USE_DELAY_POOLS_FALSE@DELAY_POOL_SOURCE =