I have just worked out the solution to this problem this morning. You need to edit two files and add some iptables rules that will allow your intranet traffic to bypass both squid and dansguardian. The files are:
/etc/rc.d/rc.firewall
/etc/rc.d/rc.local
In /etc/rc.d/rc.firewall find these lines:
# DansGuardian Transparent Filtering Setup
/sbin/iptables -t nat -A PREROUTING -i $GREEN_DEV -p tcp --dport 80 -j REDIRECT --to-port 8080
And add these two lines ABOVE them:
/sbin/iptables -t nat -N POSTSQUID
/sbin/iptables -t nat -A PREROUTING -i $GREEN_DEV -p tcp --dport 80 --destination ###.###.###.###/## -j POSTSQUID
replace the hashes with your intranet's network address.
Next find these lines:
# Custom prerouting chains (for transparent proxy and port forwarding)
/sbin/iptables -t nat -N SQUID
/sbin/iptables -t nat -A PREROUTING -j SQUID
/sbin/iptables -t nat -N PORTFW
/sbin/iptables -t nat -A PREROUTING -j PORTFW
And alter them so they look like this:
/sbin/iptables -t nat -N PRESQUID
/sbin/iptables -t nat -A PREROUTING -j PRESQUID
/sbin/iptables -t nat -N SQUID
/sbin/iptables -t nat -A PREROUTING -j SQUID
/sbin/iptables -t nat -N PORTFW
/sbin/iptables -t nat -A PREROUTING -j PORTFW
Save /etc/rc.d/rc.firewall and edit /etc/rc.d/rc.local and add these lines:
/sbin/iptables -t nat -A PRESQUID -p tcp -d ###.###.###.###/## -j POSTSQUID
/sbin/iptables -t nat -A POSTSQUID -j ACCEPT
Replace the hashes with your intranet network address.
Save /etc/rc.d/rc.local
Next run these commands:
/etc/rc.d/rc.firewall restart
/etc/rc.d/rc.local
It should all be working now. Normal traffic will be passed through squid and dansguardian and intranet traffic will bypass them and go via the VPN.
Regards
Richard