Wednesday, November 18, 2009

Squid -- Transparency

Edit: updated for what I'm currently doing in 10.04 and 10.10 (ubuntu)

A few guides gave ideas on how to get iptables to work:
# Add to IP tables
# squid server IP
lan=`ifconfig -s | grep eth | awk '{print $1}'`
s_port="3128"
iptables -t nat -A PREROUTING -i $lan -p tcp --dport 80 -j REDIRECT --to-port $s_port


The problem is on restarting the computer, it seemed to disappear. So I thought I had figured it out, until it didn't work anymore.

Eventually I ended up re-building it each time ppp0 was created by putting it as a process in ip-up.d/

Oh, also don't forget to add "transparent" to the line in the squid.conf file.

http_port 3128 transparent
To learn more about iptables: http://www.frozentux.net/documents/iptables-tutorial/

From here you can directly connect squid to apt-cacher-ng, and have transparent caching of your debian files. Just set up apt-cacher-ng as a peer.

No comments:

Post a Comment