Squid proxy with multi wan links and load balancer

hi all
my netowrk interface
eth0 wan1
eht1 wan2
ent2 wan3
eth3 lan

my iptable T1
wan1 ip dev eth0 scope link dev eth3 scope link
default via wan1's dev eth0

iptables -t mangle -A PREROUTING -s -j MARK --set-mark 1

http traffic not follow the iptables
sometime via eth1 or eth2

after squid.conf added "tcp_outgoing_address wan1's gateway"
it worked correctly

why??? what squid do???

the http traffic
192.168.1.x http resquset => iptables(nat) redirect 3128 => iptables
(mangle) mark 1
=> route table T1 => internet

why iptables can't not control the traffic

i want creat the tables T2 =>for load balancer
wna1's gateway dev eth0 scope link
wan2's gateway dev eth1 scope link
wan3's gateway dev eth3 scope link dev eth3 scope link
nexthop via wna1's gateway dev eth0 weight 1 onlink
nexthop via wna2's gateway dev eth1 weight 1 onlink
nexthop via wna3's gateway dev eth2 weight 1 onlink

how to make squid route follow this table

thanks for any advice!!!

I don't think squid could handle the traffic shaping, what I did once was to configure IP route version 2, to have 2 internet providers, and control the access by routing, I wrote all here http://soad1982.blogspot.com/2010/02...-on-linux.html

If you just have one network behind the linux then you can just add the lines at the bottom of the configuration:

ip route add default scope global nexthop via $P1 dev $IF1 weight 1 \
nexthop via $P2 dev $IF2 weight 1

Source: http://www.linuxquestions.org/questions/linux-networking-3/squid-proxy-with-multi-wan-links-and-load-balancer-792457/

No comments:

Post a Comment