Routing lan http trafic to lan proxy server
Posted: Fri Nov 08, 2013 5:44 pm
Hello any help would be good guys, i'm stuck at somewhere with iptables.i have squid server on my lan and i want to route all http trafic to it but squid isn't running on router.
So setup is like this;
Router: 192.168.1.1
Lan:192.168.1.0/24
Squid-server: 192.168.1.3
Squid-port:3128
i made a firewall.user rule to prerouter http traffic to squid but i have problems with it.
With this code, routing doesn't work.
If i add this line to it, routing to squid works but squid gives invalid url messages.
So how i can work this without any error ? I searched the web but didn't get solution for it, openwrt wiki seems got old about this.
So setup is like this;
Router: 192.168.1.1
Lan:192.168.1.0/24
Squid-server: 192.168.1.3
Squid-port:3128
i made a firewall.user rule to prerouter http traffic to squid but i have problems with it.
Code: Select all
iptables -t nat -A POSTROUTING -p tcp -m iprange --src-range 192.168.1.5-192.168.1.254 --dport 80 -j DNAT --to-destination 192.168.1.3:3128
If i add this line to it, routing to squid works but squid gives invalid url messages.
Code: Select all
iptables -t nat -A PREROUTING -j MASQUERADE