Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-01-2010, 08:28 PM   #1
LQ Newbie
Registered: Feb 2010
Posts: 3

Rep: Reputation: 0
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!!!
Old 03-02-2010, 10:10 AM   #2
Registered: Sep 2007
Distribution: Debian Lenny
Posts: 61
Blog Entries: 2

Rep: Reputation: 19
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

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transparent Proxy with 2 WAN links yorbs8 Linux - Networking 7 03-01-2010 08:32 PM
Squid Load Balancer ravis007 Fedora 1 12-08-2009 03:59 AM
Using Linux as a router and load balancer between two DSL WAN connections MikeyCarter Linux - Software 3 04-02-2009 09:26 AM
Load balancing through squid proxy server punit1985 Linux - Newbie 3 11-02-2008 02:51 AM
squid proxy: load startup? flump Linux - Software 1 08-28-2003 10:42 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration