Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to make openwrt's iptables from my router to direct to my squid proxy on my machine (since there is no enough space in router's flash memory) but even if I have my squid config ok ( meaning I set it up as proxy in my system and it works fine) when I set this up I won't get any response

iptables -t nat -I PREROUTING -s -p tcp -j DNAT --to-destination

What should I change in my config ?

I have something like this

iptables -t nat -A PREROUTING -i eth0 -s ! squid-box -p tcp --dport 80 -j DNAT --to squid-box:3128
iptables -t nat -A POSTROUTING -o eth0 -s local-network -d squid-box -j SNAT --to iptables-box

but I do not really understand how should I perform this with my config.

br-lan    Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX 
          inet addr:  Bcast:  Mask:

eth1      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet addr:188.XXX.XX.XX  Bcast:  Mask:
share|improve this question

I also have an openwrt router configured to forward anything going to port 80 to port 3128 and then SNATting it to include the router's ip fro every client request. The thing is that everything was working with the default config ( transparent only added) with the 3.2 version but the 3.3.8 version is not happy. If I switch it to transparent and use the above rules in openwrt, it is denying everything. If I switch it to manual ( configure each client separately) it is working as expected..

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.