LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2005, 11:08 AM   #1
otisthegbs
Member
 
Registered: May 2003
Location: Vancouver
Distribution: RH9
Posts: 100

Rep: Reputation: 15
Load Balancing


Hi All

I have a community network in my apartment block where we all pitch in for two internet connections and then we all share them. I'm the admin for setting all this and am wondering if there is a way of switching between the two connections. Two ISP uplinks are of course running to a 3-nic'd Gentoo router.

Two balance the load under the two isp's I made this route
ip route add default scope global nexthop via (gateway1) dev eth0 weight 1 nexthop via (gateway2) dev eth1 weight 1

I have also, using iproute2, set up two tables, T1 and T2. T1 runs to ISP 1 and T2 runs to ISP 2, I'm using fwmark to make this happen.

IE:
ip rule add fwmark 1 table T1
ip rule add fwmark 2 table T2

So using an iptables command like
Code:
iptables -A PREROUTING -i eth2 -t mangle -p tcp --dport 22 -j MARK --set-mark 2
i can send all ssh traffic thru ISP 2. What I want to do is: If ISP 1 goes down then for the route to mark all packets with 2, or vice versa. Something to the effect of "if so many packets go answered in 'x' seconds then switch routes to this"

Now maybe I'm going about this wrong and ip and tc commands can't do this, but I don't know. Now I know that zebra has something called OSPF, open shortest path first, but I'm not quite sure if this will solve my problem. Plus can zebra and the ip command work in conjunction of each other.
 
Old 02-08-2005, 10:59 AM   #2
otisthegbs
Member
 
Registered: May 2003
Location: Vancouver
Distribution: RH9
Posts: 100

Original Poster
Rep: Reputation: 15
anyone?
 
Old 02-08-2005, 11:15 AM   #3
Brian Knoblauch
Member
 
Registered: Jan 2005
Distribution: OpenSuse Tumbleweed
Posts: 288

Rep: Reputation: 39
To do simple failover, OSPF is an appropriate solution, however, your ISP needs to be in the OSPF area with your router.

Per packet load balancing is most likely not possible at all on those circuits, but per flow (which fails over automatically) should be. However, once again, you need the ISP to do stuff on their end too, which I'm guessing is part of the problem?
 
Old 02-10-2005, 02:06 PM   #4
otisthegbs
Member
 
Registered: May 2003
Location: Vancouver
Distribution: RH9
Posts: 100

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Brian Knoblauch
To do simple failover, OSPF is an appropriate solution, however, your ISP needs to be in the OSPF area with your router.

Per packet load balancing is most likely not possible at all on those circuits, but per flow (which fails over automatically) should be. However, once again, you need the ISP to do stuff on their end too, which I'm guessing is part of the problem?
I'm not sure if the ISP is the problem, I have two different ISP's. Now I don't know if the two seperate ISP's are in area with my router. Per packet load balancing is pretty crappy on my setup and generally wouldn't work unless I went round robin, but since one line is faster than the other this would slow me down more than anyything. Thats why I put the mark system in.

My basic question is that if I punch in all the stuff zebra needs into ospfd will it failover?
 
Old 02-10-2005, 02:16 PM   #5
Brian Knoblauch
Member
 
Registered: Jan 2005
Distribution: OpenSuse Tumbleweed
Posts: 288

Rep: Reputation: 39
Quote:
Originally posted by otisthegbs
I'm not sure if the ISP is the problem, I have two different ISP's. Now I don't know if the two seperate ISP's are in area with my router. Per packet load balancing is pretty crappy on my setup and generally wouldn't work unless I went round robin, but since one line is faster than the other this would slow me down more than anyything. Thats why I put the mark system in.

My basic question is that if I punch in all the stuff zebra needs into ospfd will it failover?
Ouch, I didn't realize they were 2 completely different ISP's. Round Robin per packet may not work for you anyways if either ISP does uRPF filtering (like they should) on their end. The only way I can think of (off the top of my head) to seamlessly do what you want, since you're multi-homed, is to get an AS number and run BGP... This will definitely require coordination with both ISP's!
 
  


Reply



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
How to do load balancing tkt Linux - Networking 0 04-27-2005 01:22 AM
how to do load balancing? yenonn Linux - Networking 2 07-27-2004 09:20 PM
load balancing on rh ntaizi Linux - Software 0 12-17-2003 06:41 AM
new to load balancing suliu Linux - General 3 05-12-2003 08:08 AM
Load balancing ?? Lucsi Linux - Newbie 1 07-16-2002 12:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:02 AM.

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