Finally figured out an elegant and easy solution (thanks to Dimitar Katerinski helping via the
netfilter@list.netfilter.org mailing list)
1)Keep the normal settings for squid (no tranparent proxy needed since users are internal to the same machine)
2) Set up two iptables rules to only let squid reach port 80 and only let dansguardian reach port 3128 (where squid is listening).
# allow only squid to be able to connect to port 80
iptables -A OUTPUT -p tcp --dport 80 -m owner ! --uid-owner squid -j REJECT --reject-with tcp-reset
#allow only DG to be able to connect to 3128.
iptables -A OUTPUT -p tcp --dport 3128 -m owner ! --uid-owner dansguardian -j REJECT --reject-with tcp-reset
These rules force the users to put in the proper proxy info into their browsers in order to connect to internet.
Work great !!
Other boxes on the local lan can also access dansguardian webfiltering using same proxy address [
http://this_box_lan_ip_addr:8181 ] (although there is nothing forcing other boxes through this path) . The above iptables rules only require that local users on this machine use Dansguardian.
Cheers!
Ken