From owner-freebsd-isp Wed Jan 3 18:31:14 2001 From owner-freebsd-isp@FreeBSD.ORG Wed Jan 3 18:31:12 2001 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from bsdie.rwsystems.net (bsdie.rwsystems.net [209.197.223.2]) by hub.freebsd.org (Postfix) with ESMTP id A484437B400 for ; Wed, 3 Jan 2001 18:31:11 -0800 (PST) Received: from bsdie.rwsystems.net([209.197.223.2]) (3343 bytes) by bsdie.rwsystems.net via sendmail with P:esmtp/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) id for ; Wed, 3 Jan 2001 20:30:03 -0600 (CST) (Smail-3.2.0.111 2000-Feb-17 #1 built 2000-Jun-25) Date: Wed, 3 Jan 2001 20:30:03 -0600 (CST) From: James Wyatt 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: > 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