I have CentOS 7 on an OpenVZ VPS running OpenVPN, Privoxy, and CSF.
When redirecting OpenVPN's web traffic to Privoxy, with my current configuration, I can't reach the internet.
From my csfpre.sh
:
iptables -A FORWARD -s 172.27.1.0/24 -j ACCEPT
iptables -A FORWARD -i as0t0 -o venet0:0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i venet0:0 -o as0t0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A PREROUTING -i as0t0 -p tcp -m multiport --dports 80,443 -j REDIRECT --to-ports 8118
iptables -t nat -A POSTROUTING -s 172.27.1.0/24 -o venet0:0 -j MASQUERADE
iptables -A OUTPUT -o as0t0 -j ACCEPT
When I comment out the REDIRECT
line, I can reach the internet while connected via OpenVPN.
I would like to redirect OpenVPN's web traffic to Privoxy and still be able to reach the internet.
Update: I removed the 443 port redirection so the REDIRECT
line is now:
iptables -t nat -A PREROUTING -i as0t0 -p tcp --dport 80 -j REDIRECT --to-port 8118
This FIXED the issue!