Slashdot Mirror


Routing to Multiple Providers with Linux?

Dale Woolridge asks: "Suppose I want to increase the availability/reliability of my home network's connection (to the internet) and high-speed & low-latency are important. I've been using cable for almost two years now, but there are sometimes inexplicable outages which leave me without net access for hours at a time. Rather than switch to another type (aDSL) of provider, I augmented my connectivity by adding another provider. I want to automate the selection of outgoing route, but am willing to live with manual failover in cases where a particular interface/route is available but my upstream provider is having routing problems. Basically, I want to be multi-homed, but my choice of options is limited; clearly, I cannot fiddle with upstream routing."

"To that end, I did a little searching and came up with a few items to help me along the way. First, I had to download the iproute2 package, add a routing table for multipath routing based on this example, and do some interface/packet matching using this information. Unfortunately, none of this seems sufficient to do what I want. Based on what I've read, the issue lies in source address selection. If the multipath table is my default table, I think it chooses the source address based on the weights of the hops in that route. Even with interface selection rules (ip rule add dev eth0 table ...) the issue (routing problems to/from linux box) persists. While I am using the 2.2.19 kernel, I would consider moving to a newer kernel iff I can achieve my goal with it.

Based on the above, my question is this: Has anyone successfully configured their home network as described above under linux? I am interested in knowing how to do it."

3 of 21 comments (clear)

  1. BGP by galmeida · · Score: 4

    You'll have to use BGP. Maybe gated, see http://www.gated.org/

  2. Failover rather than multihoming by elbuddha · · Score: 5

    You have 2 basic problems with this scheme:
    1. You have been provided with 2 different IP addresses or address spaces, one from each provider, neither of which is portable (neither provider is going to accept traffic from you with a source address in the other provider's IP block).
    2. Neither provider is going to announce routes to you, period. Not with BGP, not even with RIP. So forget about doing path selection with any routing protocol
    Sounds like what you really need is a failover/shadow scheme rather than actual multihoming.

    The way I would go about that goal is:
    • Figure out what manual commands you go through in order to switch over your connectivity from one provider to the other, and back. Write those commands out in a script of your choice.
    • Determine a mechanism and write another script for determining if a connection has gone bad, and run that script as a cron job or background task. You may even desire to combine the two scripts, but personally I would keep their functionality separate.
    • Have the connection-testing script call the connection-changing script when your connection goes down. You could even have the testing script then test the new connection as change back to the first if it goes down, or continue to monitor the primary connection and switch back when it comes up.
    More work for you of course, but have fun with it. Do a good enough job and someone else may even want to use it too.
  3. God, are you are so geeky its scary. by Beowulf_Boy · · Score: 4

    "My Cable ISP goes out once a month, so I bought another Cable connection for 40$ a month so I will never be without my connection"
    You are sad, very sad.
    I have RoadRunner, it only goes out when the electric does, so I can't use it anyways.
    Oops, I forgot, you have your basement filled with leadAcid batterys so you will never be without a computer.
    Lemme guess, you also have an I-opener in the Crapper so you can check your e-mail when "Other" business arises.
    Go outside, get some fresh air, take a walk, something, but don't pay 40$ a month so you will have a backup connection for a few hours a month or so. Thats redicoulas.
    IF you really want to, I would use Freesco, it allows connecting 3 networks together, and it just sees the cable modem as a network, I use it right now, ( I have it running on a p75 with 4 megs Ram) and it works great, Runs Linux, and was a sinch to install.