Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jan 2001 16:15:27 -0800 (PST)
From:      Tom Samplonius <tom@sdf.com>
To:        Tim Gustafson <tim@falconsoft.com>
Cc:        freebsd-isp@freebsd.org
Subject:   Re: Question Re: Multiple Default Gateways
Message-ID:  <Pine.BSF.4.05.10101031603090.8253-100000@misery.sdf.com>
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:

...
> 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
> route add -net 0.0.0.0 -netmask 0.0.0.0 10.0.1.1
> route add -net 0.0.0.0 -netmask 0.0.0.0 10.0.2.1
> route add -net 0.0.0.0 -netmask 0.0.0.0 10.0.3.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

  You can only have one destination (gateway) per route.  You are trying
to add 4 identical routes with different gateways.  The behaviour is
undefined.

  There is a patch that load balances over multiple destinations for the
same route.  This is how everyone else defines the behavour of multiple
destinations per route (aka equal cost routing, or multipathing).

...
> 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 

  Nope, unless it was in referece to Chrissy Lake's multipath patch.

...
> 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.

  That isn't how classic TCP and IP routing works.  However, you can use
the ipfw fwd option to specify that traffic from a particular IP gets
pushed to a specifed gateway.  Basically, ipfw fwd is way to implement
policy based routing, which is what you probably want.

> Thanks for any help.
> 
> Tim


Tom



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.05.10101031603090.8253-100000>