Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to use two different isp connections to load balance the request. I have tried it with ip route:

ip route replace default scope global nexthop dev ppp0 weight 1 nexthop dev ppp1 weight 1

But it doesn't work well. Nearly all requests timed out.

I am using squid 2.7. Is there any other possibility to use that?

share|improve this question

migrated from superuser.com Oct 19 '11 at 9:59

This question came from our site for computer enthusiasts and power users.

    
Before you even think about the Squid configuration, get the policy routing configured correctly so that both connections work. –  David Schwartz Oct 18 '11 at 22:55
    
The route command provided would create equal cost routes out of the two connections. Routing happens at an IP packet level not a TCP session level, so half of the packets in a single http session would go out one interface, and the other out of another interface. From the recieving side, they would see this as seperate traffic from two different IP addresses. It would appear entirely broken. –  Paul Oct 18 '11 at 23:01
    
Which connection a packet takes has to be based on its source address. This will ensure a valid setup. Then you can work on getting Squid to load balance by influencing how it chooses the source addresses it uses for its outbound connections. –  David Schwartz Oct 18 '11 at 23:05
    
So it would be possible to add routes depending on the src ip or what would you advice? –  CSchulz Oct 18 '11 at 23:10
1  
I prefer to load balance at the router using one with a dual WAN interface - much simpler to manage. –  Linker3000 Oct 19 '11 at 0:06

1 Answer 1

up vote 0 down vote accepted

It would be easiest to tell squid to use http cache from both ISPs and round-robin between these HTTP caches.

But here's some stuff on source routing: http://linux-ip.net/html/adv-multi-internet.html

Use iptables -j MARK to mark the packets based on source address, then create a new routing table in */etc/iproutes/rt_tables* and add a new rule ip rule add fwmark 4 table 4 priority 10000.

share|improve this answer

Your Answer

 
discard

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.