Squid im Intercept-Modus via TPROXY mit nftables
Zur Navigation springen
Zur Suche springen
Squid im Intercept-Modus per REDIRECT (lokal auf dem Proxy)
Voraussetzungen
- Der Proxy hat eine eigene IP im LAN, z. B. 10.88.113.51
- Squid läuft direkt auf diesem Host
- Der Traffic wird per iptables/nftables von Port 80/443 auf lokale Ports umgeleitet
- Keine TPROXY-Konfiguration nötig
Squid-Konfiguration
http_port 3128 intercept https_port 3129 intercept ssl-bump cert=/etc/squid/certs/proxyCA.pem key=/etc/squid/certs/proxyCA.key
- Optional
- SSL-Bump
ssl_bump peek all ssl_bump bump all sslproxy_cert_error allow all sslproxy_flags DONT_VERIFY_PEER
nftables-Konfiguration (lokal auf dem Proxy)
- nft add table ip nat
- nft add chain ip nat prerouting '{ type nat hook prerouting priority dstnat; policy accept; }'
- nft add rule ip nat prerouting tcp dport 80 redirect to :3128
- nft add rule ip nat prerouting tcp dport 443 redirect to :3129
Kernel-Module laden (falls nötig)
- modprobe nf_nat
- modprobe nf_conntrack
Squid-Rechte (kein TPROXY nötig)
Keine `setcap`-Anpassung notwendig – REDIRECT reicht.
Test & Logs
- tail -f /var/log/squid/access.log
- tail -f /var/log/squid/cache.log