[clug] Multi-homing

Martijn van Oosterhout kleptog at svana.org
Wed Jan 28 01:14:55 GMT 2004


On Wed, Jan 28, 2004 at 11:48:56AM +1100, Dennis M. Gray wrote:
> I have been running a Red Hat 7.1 distro with a permanent dial-up
> to my ISP. I intend to stop using that and have added an ADSL
> service on another phone line. I am using the eth0 NIC for the ADSL.
> 
> For a short period I want to enable both interfaces. When I bring
> up the eth0 at the same time that the ppp0 is up, I can no longer
> communicate via ppp0. The two interfaces are on two completely
> different networks.

One of your problems is that both links will try to set a default route.

Secondly, do either of your providers allow asymetric routing? If not, you
need to get down and dirty. I presume you're running some kind of service on
the permanent dial-up or you wouldn't be considering keeping it.

The real solution is source based routing. So connections that come in your
dialup go out the dialup and the same for the ADSL. For that you need the
new iproute2 stuff in 2.4+. Try the LARTC (www.lartc.org) but the basic idea
is below. Note, if have only setup it up with static IPs, if either of the
IPs is dynamic you could be be into some fun. Also, this probably isn't the
only way to do it, I'm sure there are some fancy netfilter modules that
could do it also.

Hope this helps, though I admit it can be quite confusing...

Multi-homing is a pain. Do you really want this?

--- begin ---
# Lookup normal routing table but at priority 500 instead of 32766
ip rule add lookup main prio 500

# Setup later tables at lower priority
ip rule add from <dialup ip>         lookup dialup prio 600
# Everything else
ip rule add                          lookup adsl   prio 601

# Set default route for dialup
ip route add default via <dialup gw>     table dialup

# Set default route everything else
ip route add default via <adsl gw>        table adsl

# Remove default route from main table to make it work
route del default

# Clear routing cache
ip route flush cache
--- end ---

-- 
Martijn van Oosterhout   <kleptog at svana.org>   http://svana.org/kleptog/
> (... have gone from d-i being barely usable even by its developers
> anywhere, to being about 20% done. Sweet. And the last 80% usually takes
> 20% of the time, too, right?) -- Anthony Towns, debian-devel-announce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20040128/d151beac/attachment.bin


More information about the linux mailing list