Hu wrote:
Your description does not explain how you expect traffic shaping to fit into this, or where you want to accomplish it.
Iptables has limit, and as far as I know.. it can't traffic shape any connection going directly in or out transparent proxy if both routing & squid made in the same box
But anyway, Let me try to explain it because maybe you know something that I don't.
Client(1.2.3.5) ----------> (1.2.3.1)<eth0>Router<eth1>(2.2.2.2) ----------> 2.3.4.5
FakeServer(1.2.3.4) --->
OK, my only purpose is this:
client 1.2.3.5 connect to squid in 1.2.3.1:3128 going to 2.3.4.5 normally, but I want to redirect it to 1.2.3.4
Originally, I tried:
iptables -t nat -A PREROUTING -d 2.3.4.5 -j DNAT --to 1.2.3.4
nothing happened, so I tried doing:
iptables -t nat -A PREROUTING -d 2.3.4.5 -p tcp --dport 3128 -j DNAT --to 1.2.3.4
iptables -t nat -A PREROUTING -d 2.3.4.5 -p tcp --dport 80 -j DNAT --to 1.2.3.4
again, nothing happen.
Squid already intercept any PREROUTING on port 3128 or 80.
so I tried to mess around the OUTPUT...
iptables -A OUTPUT -t nat -o eth1 -d 2.3.4.5 -j DNAT --to-destination 1.2.3.4
also doesn't filter anything....
squid apparently override this rule so I took conclusion that Iptables can't do anything in this situation.
I hope someone can help me on this.
and please, if your answer is "just add another router" or "separate the squid and routing"... just don't replay to this thread.
Ty.