From owner-freebsd-isp Wed Jan 3 17: 0:21 2001 From owner-freebsd-isp@FreeBSD.ORG Wed Jan 3 17:00:19 2001 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from misery.sdf.com (misery.sdf.com [204.244.213.49]) by hub.freebsd.org (Postfix) with ESMTP id 96C6837B400 for ; Wed, 3 Jan 2001 17:00:17 -0800 (PST) Received: from tom (helo=localhost) by misery.sdf.com with local-esmtp (Exim 2.12 #1) id 14Dy44-0003gK-00; Wed, 3 Jan 2001 16:15:32 -0800 Date: Wed, 3 Jan 2001 16:15:27 -0800 (PST) From: Tom Samplonius To: Tim Gustafson Cc: freebsd-isp@freebsd.org Subject: Re: Question Re: Multiple Default Gateways In-Reply-To: <5.0.0.25.2.20010103191232.00a57260@esther.falconsoft.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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