Only allow HTTP access through proxy?
Hello,
Have got a linux server working, with 2 NICs, using firestarter and privoxy, taking data from a adsl modem/router and feeding it to a wireless based lan. All seems to be fine and the privoxy stuff works but the downstream lan users can still bypass the proxy, by just not setting the proxy, that is by direct access to http via port 80. I am sure that this can be blocked/denied by a call to iptables (which I use for nat) but can't figure out the exact syntax. Would appreciate some assistance. Regards, Geoff. |
sounds like what you want to do is transparent proxying... by doing it like this, all tcp port 80 packets going from the lan to the internet will be redirected automatically to the proxy... this way the machines on the lan don't even need to be configured to use a proxy, the proxying becomes transparent to the users on the lan... this is what the iptables rule would look like if eth1 is your lan interface and your proxy is listening on port 3128:
Code:
iptables -t nat -A PREROUTING -p TCP -i eth1 --dport 80 \ Code:
httpd_accel_host virtual http://www.tldp.org/HOWTO/TransparentProxy.html just my :twocents:, good luck... |
i just found this in the Privoxy Faq (Section 3.18):
Quote:
|
Thanks for your help. This is proving to be a fair bit more complicated than I expected. But with kids and the internet, what is the choice?
One other question, in you post you mention: sounds like what you want to do is transparent proxying... by doing it like this, all tcp port 80 packets going from the lan to the internet will be redirected automatically to the proxy... Sorry to appear thick but what about the tcp port 80 packets going from the internet to the lan? Regards, Geoff. |
Quote:
|
thanks again, I guess I should have tumbled to that.
I don't mind having to configure the kids computers to use the privoxy port but, as I said earlier, denying access to the "raw" http port 80 is also an aim. Am I right in assuming that the code mentioned above: iptables -t nat -A PREROUTING -p TCP -i eth1 --dport 80 \ -j REDIRECT --to-ports 3128 will mean that computers on the lan connected via eth1 will not have access to port 80? thanks and regards, Geoff. |
i see what you mean now...
in that case, you can block all forwarding of 80/TCP packets by executing this command (assuming eth1 is your LAN interface): Code:
iptables -I FORWARD -p TCP -i eth1 --dport 80 -j REJECT if you don't wanna mess with your current firewall configuration just add that command to your startup file (maybe rc.local) and you should be fine... by doing it like this you don't need to worry about the transparent proxying stuff anymore... :) i hope this helps... good luck!!! |
Yes, I just want a way to deny the lan users access to the "usual" http port.
Thanks a lot for your assistance. Regards, Geoff. |
All times are GMT -5. The time now is 06:42 PM. |