I would like to limit the access of the Privoxy port to a selected IP range. Background: I'm using an IPSec-VPN which users get 10.0.0.0/8 addresses assigned and only those users should be able to use the proxy service and "foreign users" are blocked out.
I tried the following iptables rules:
iptables -A INPUT -p tcp --dport 8118 -s 10.0.0.0/8 -j ACCEPT
iptables -A INPUT -p tcp --dport 8118 -j DROP
Unfortunately iptables keeps blocking the VPN users with their 10.0.0.0/8 address.
I use these rules to route the VPN traffic to the internet:
iptables -A INPUT -p udp -m udp --dport 500 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 4500 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 1701 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.1.2.0/24 -o eth0 -j MASQUERADE
iptables -A FORWARD -s 10.1.2.0/24 -j ACCEPT
Does anyone have an idea how to make this work? Thanks!
P.S.: And yes, the Proxy and VPN work without these rules ;-)