[SATLUG] **SOLVED** Routing from one box to two different ISPs
Daniel J. Givens
daniel at rugmonster.org
Fri Apr 6 17:39:29 CDT 2007
David Salisbury wrote:
> Well, now I've got it working!! Using the guide at the link that I had mentioned before:
>
> I now have a new routing table:
>
> Destination Gateway Genmask Flags Metric Ref Use Iface
> <DSL Netmask> * 255.255.255.255 UH 0 0 0 eth0
> <RR Netmask> * 255.255.255.255 UH 0 0 0 eth1
> <RR Broadcast> * <RR Netmask> U 0 0 0 eth1
> <DSL Broadcast> * <DSL Netmask> U 0 0 0 eth0
> 127.0.0.0 * 255.0.0.0 U 0 0 0 lo
> default <DSL Gateway> 0.0.0.0 UG 0 0 0 eth0
>
> And that routing table, coupled with the ruleset of 2 rules mentioned in the link above, has now created the correct traffic flow to the box! All of its functions seems to work from both interfaces now (web, etc). Cool!! Thanks for everyone's help and input! Now I will look into the multipathing that you brought up, Daniel, because I am also interested in fallback connections and the like.
Yeah, that's only using your DSL connection and won't even roll over to
use your cable if the DSL drops.
I just got done testing my kernel sans CONFIG_IP_ROUTE_MULTIPATH_CACHED
successfully. Also, it does look to be a standard (experimental) network
option in the stock kernel[1].
I got the routing to work with the following command:
$ ip route add default equalize \
nexthop via <gateway 1> dev eth0 \
nexthop via <gateway 2> dev eth0
The way it works is each new route it adds to the route cache is
alternated between the two. That means that full each unique ip you
visit will be sent through one gateway only. This isn't a packet level
alternation, but a route based alternation. I wouldn't say it's as good
as the load balancing Cisco does, but it could definitely be beneficial
in cases where you had lots of outgoing connections, like a network with
multiple users, bittorrent downloading, etc.
Mind you, I have two WRT54Gs and setup my desktop to do multipath
routing to both of them on the same interface. If you need NAT on a
router with two interfaces, see this guide[2].
If you don't want or need route balancing, I think you can just remove
the "equalize" option. To test, you could just unplug the network
connection to one gateway and see if it detects it properly.
This has been a fun little distraction. I'm going to stop sponging off
my neighbors wireless now. Good luck and let us know if you get it fully
working!
Cheers,
Daniel
[1] http://kernel.xc.net/html/linux-2.6.20/i386/#IP_ROUTE_MULTIPATH_CACHED
[2] http://www.leglug.org/node/Load%20Balancing%20Across%20Multiple%20Links
More information about the SATLUG
mailing list