Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jan 2001 20:30:03 -0600 (CST)
From:      James Wyatt <jwyatt@rwsystems.net>
To:        Tim Gustafson <tim@falconsoft.com>
Cc:        freebsd-isp@freebsd.org
Subject:   Re: Question Re: Multiple Default Gateways
Message-ID:  <Pine.BSF.4.10.10101031852200.92744-100000@bsdie.rwsystems.net>
In-Reply-To: <5.0.0.25.2.20010103191232.00a57260@esther.falconsoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 3 Jan 2001, Tim Gustafson wrote:
> I just installed a D-Link DFE-570TX 4-Port network card into one of my 
> FreeBSD 4.2-STABLE machines.  It works great so far, and I have different 
> IPs assigned to each of the 4 ethernet ports, as follows:
> 
> dc0: inet 10.0.0.2 netmask 0xffffff00 broadcast 10.0.0.255
	[ ... ]
> My question is this:
> 
> I'd like to set up four default gateways on the machine, one for each of 
> the ethernet ports, as follows:
> 
> route add -net 0.0.0.0 -netmask 0.0.0.0 10.0.0.1
	[ ... ]
> However, after the initial default gateway is set up, I get this for each 
> of the three subsequent additions:
> 
> route: writing to routing socket: File exists
> add net 0.0.0.0: gateway 10.0.1.1: File exists
> 
> How can I make it so this machine will have the four different default 
> gatways?  The reason I have them all is for redundancy - the application 
> I'm creating pings each of the server's IPs before connecting, and connects 
> to the one with the lowest round-trip time (thereby load balancing for me, 
> and also allowing one or two of the DSL lines to be down and people can 
> still get through).
> 
> I've read some of the archives of this list where it says you can just add 
> them as I've mentioned above, but it doesn't seem to work like people have 
> explained it.  Do I need to set any special options in the kernel or in the 
> rc.conf file?
> 
> Incidentally, I don't need or want any of the interfaces to route packets 
> to the other interfaces.  When a TCP connection comes in on the 10.0.0.2 
> interface, I need the outbound part of that TCP connection to go back out 
> the 10.0.0.2 interface.

I wasn't sure how a multipath default gateway would look until I got to
the bottom of your message. This is a lot like what I want to do with a
multiport card and why I've been interested in this card on the FreeBSD
list(s). I'm thinking about connecting some BRIs, an ADSL, and a small
wireless segment to some low average usage ENets.

As a WAG, should you be saying something more like:

    route add -net 0.0.0.0 -netmask 0.0.0.0 -interface dc0 10.0.0.1
                                            ^^^^^^^^^^^^^^

I didn't think that "route" would do exactly what I wanted and was more
thinking of trying ipfw rules. As I understand things, the rules could
direct packets from 10.0.0.2 headed for anywhere else to the proper ENet
card. If a connect is made to an ISDN address and the only default route
is set for ADSL, the reply packets are dropped by the ADSL router as
"foreign" - usually a good thing. If my ADSL goes down, the ISDN path is
useless until someone manually updates the default route. (I could
automate the changeover, but I'd rather it just always worked.) - Jy@




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10101031852200.92744-100000>