Transparent http proxy configuration for Squid/DansGuardian excluding the proxy itself and root (to prevent problems with apt and http repositories on Ubuntu).
iptables -t nat -A OUTPUT -p tcp ! --out-interface lo -m owner ! --uid-owner proxy -m owner ! --uid-owner root --dport 80 -j REDIRECT --to-port 8080
iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- anywhere anywhere ! owner UID match proxy ! owner UID match root tcp dpt:www redir ports 8080
Linux Firewall module only shows first UID (proxy in this example) in both the rule summary page an in the detail under "Sending unix user".
If this a known limitation is there a workaround? I'm relatively new to iptables and don't know how else to structure this rule to make Webmin happy.
This is a limitation in Webmin .. it doesn't know how to parse IPtables rules where the same flag appears multiple times. Unfortunately, fixing this isn't that easy either ..