*BSD News Article 78496


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!foxhound.dsto.gov.au!fang.dsto.defence.gov.au!ns.saard.net!news.camtech.com.au!news.adelaide.on.net!news.ade.connect.com.au!news.mel.connect.com.au!news.syd.connect.com.au!news.bri.connect.com.au!corolla.OntheNet.com.au!news
From: Tony Griffiths <tonyg@OntheNet.com.au>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Dual Ethernet Cards
Date: Wed, 18 Sep 1996 01:47:49 +1000
Organization: On the Net (ISP on the Gold Coast, Australia)
Lines: 59
Message-ID: <323EC825.5936@OntheNet.com.au>
References: <3238986E.446B@phoenix.net> <51e7kt$jh@anorak.coverform.lan> <323C7859.1CFB@phoenix.net>
Reply-To: tonyg@OntheNet.com.au
NNTP-Posting-Host: swanee.nt.com.au
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0 (WinNT; I)
To: Geoff Mohler <gemohler@phoenix.net>

Geoff Mohler wrote:
> 
> Brian Somers wrote:
> 
> > : How can I have two cards, and two default gateways with
> > : FreeBSD 2.1.5.
> >
> > You can't.  The default gateway is the target for all packets that havn't
> > got a specific entry in your routing table.  It doesn't make sense to have
> > two defaults.  Have a look at the route man page - it's a bit cryptic
> > unless you already know what it says ......
> >
> > What specifically are you trying to achieve ?
> 
> I am hosting two very large ftp and www sites on once machine..a machine
> that has
> plenty of capacity for it.
> 
> But I want to multihome this machine and its services, across two
> physical
> ethernet cards, and two networks.  But I do not want to route between
> the two.
> 
> Geoff

A little while ago I was playing with some DECrouter-90 routers (68k
running the Cisco "industry award winning" IOS software) and did some
kludging with multiple 'default' routes.  Essentially, I had two of
these beasts on a LAN and both had sync (ISDN thru TA) links back to
head office, although only one of the links was enabled at any point in
time.

On each router I had a default route (0.0.0.0) down the sync plughole
with a cost of 1 and another default route pointing to the other router
with a cost of 2.  RIP was also running so these routes were being
broadcast to the other hosts on the LAN.   On the host with the link
down the sync route becomes 'infinite' cost so the packets are sent
across the LAN to the active router.

This seemed to work quite well, but the ability to do this sort of thing
might be a router "special".  Either you will not be able to define a
second default route, or if you can you will have no control over which
of the two default routes will be used.  I fully suspect that the IP
code will match on the first default route it hits (assuming you can
create two) and forward all packets to that Ethernet card!

What you really want IP to do is-

(a) Load balancing such that the packet is sent to the interface with
the smallest ifq_snd transmit queue, or

(b) Send the packet to the interface based on the source address, not
the destination address so that each of the {ftp,www} servers uses it's
own dedicated interface.

I suspect that the standard BSD code can't do either of these without
some hacking, serious or otherwise!

Tony