From owner-freebsd-isp Wed Jan 3 16:20: 9 2001 From owner-freebsd-isp@FreeBSD.ORG Wed Jan 3 16:20:06 2001 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from esther.falconsoft.com (esther.falconsoft.com [216.46.87.194]) by hub.freebsd.org (Postfix) with ESMTP id 2D43837B400 for ; Wed, 3 Jan 2001 16:20:06 -0800 (PST) Received: from WOLFMAN.falconsoft.com (dhcp-05.falconsoft.com [216.46.87.222]) by esther.falconsoft.com (8.11.1/8.11.1) with ESMTP id f040K3X23404 for ; Thu, 4 Jan 2001 00:20:04 GMT (envelope-from tim@falconsoft.com) Message-Id: <5.0.0.25.2.20010103191232.00a57260@esther.falconsoft.com> X-Sender: tim@esther.falconsoft.com X-Mailer: QUALCOMM Windows Eudora Version 5.0 Date: Wed, 03 Jan 2001 19:20:18 -0500 To: freebsd-isp@freebsd.org From: Tim Gustafson Subject: Question Re: Multiple Default Gateways Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hello 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 dc1: inet 10.0.1.2 netmask 0xffffff00 broadcast 10.0.1.255 dc2: inet 10.0.2.2 netmask 0xffffff00 broadcast 10.0.2.255 dc3: inet 10.0.3.2 netmask 0xffffff00 broadcast 10.0.3.255 This, obviously, is how I have it set up for testing only. When this goes to production, it will have 4 different real-world IP addresses, one for each Internet connection I have. 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 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. Thanks for any help. Tim -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Tim Gustafson tim@falconsoft.com www.falconsoft.com (631)475-6662 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Share your knowledge - it's a way to achieve immortality. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message