Squid seems to have vanished from the opkg package tool, looking at the sticky I'm guessing this was because no one wanted to maintain it (I'd volunteer but I don't have the knowledge or the time ;-)
I did eventually manage to get this all working so I thought I'd leave a note on the forum in-case anyone else is interested in this. I did try polipo but it doesn't suit my needs.
To cross compile squid:
1: setup build environment according to openwrt instructions http://wiki.openwrt.org/doc/devel/crosscompile
2: download latest stable squid and extract. I tried 3.4.7 and it works great
3: run configure enabling cross compile options and turning off parts we're not using
./configure \ --build i386-uknown-linux-gnu \ --host mips-openwrt-linux-uclibc \ --disable-external-acl-helpers \ --disable-auth-negotiate \ --disable-auth-ntlm \ --disable-auth-digest \ --disable-auth-basic \ --disable-wccp \ --disable-wccpv2 \ --disable-snmp \ --disable-htcp \ --enable-linux-netfilter \
mkdir build # DESTDIR must be a full absolute path so change to suit your system make DESTDIR=/home/vagrant/squid-3.4.7/build install tar -C build/ -zcvf squid.tar.gz .
6: copy the squid.tar.gz file to the router using scp
7: install supporting libraries from opkg
opkg install libpthread opkg install libstdcpp opkg install librt
8: extract tarball, assuming you uploaded to /root
cd / tar zxvf /root/squid.tar.gz
9: create a squid config file somewhere - I put mine at /etc/squid.conf and based it on the example file from /usr/local/squid/etc/squid.conf.default
10: create an openwrt init script. I wrote a basic one that handles starting, stopping, creating log and cache directories. The values for these locations are sourced from the squid config file as specfied in the init script https://gist.github.com/GeoffWilliams/4 … e93c1a282e.
11: install the init script and enable. I copied my script to /etc/init.d/squid so to enable it I did:
That was pretty much all I had to do. Squid 3.4 compiles nicely out of the box for MIPS which is fantastic. If you find your still getting i386 builds, make sure you properly follow all of the instructions on the openwrt cross compiling help page, if I don't set things up properly by setting the PATH and STAGING_DIR variables g++ tells me its cross compiling but produces i386 binaries regardless.
Sample config file (cache system updates only, enable interception proxy): https://gist.github.com/GeoffWilliams/8 … d417a38bac
Sample firewall rules to enable intercept proxy (adjust addresses to suit your network): https://gist.github.com/GeoffWilliams/a … 2f7a5e289e
Have fun openwrt squidding.
(Last edited by geoffw on 29 Sep 2014, 05:36)