From owner-freebsd-net@FreeBSD.ORG Tue Feb 19 13:56:51 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0207516A469 for ; Tue, 19 Feb 2008 13:56:51 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id C520113C4F7 for ; Tue, 19 Feb 2008 13:56:50 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 07B9B9125D; Tue, 19 Feb 2008 08:56:50 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Tue, 19 Feb 2008 08:56:50 -0500 X-Sasl-enc: CF+yaB4t5VhRDjz4Lw7HZMO7emlK/+yTU22e9A0DUIbT 1203429409 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id 869EA2E31A; Tue, 19 Feb 2008 08:56:49 -0500 (EST) Message-ID: <47BAE020.1080509@FreeBSD.org> Date: Tue, 19 Feb 2008 13:56:48 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.9 (X11/20080207) MIME-Version: 1.0 To: Nick Barnes References: <38308.1203368454@thrush.ravenbrook.com> In-Reply-To: <38308.1203368454@thrush.ravenbrook.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Multiple default routes on multihome host X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2008 13:56:51 -0000 Nick Barnes wrote: > I want packets from address A1 to be sent via gateway G1, but packets > from address A2 to be sent via gateway G2. > > How do I do this? Can I just have more than one default route? I'm > remote from the machine in question, so I don't want to tinker with > the default route until I'm sure of the answer. > Others have chimed in saying that having redundant routes constitutes poor network design: it really depends where one draws the distinction between router and host. In ad-hoc and peer-to-peer networks, there is no such distinction. The forwarding code doesn't support multiple routes to the same destination, largely out of development inertia. People are looking at this now. The forwarding code doesn't support load balancing yet, it's being considered for the future. There are problems with load balancing and TCP as it can result in loss of the original packet ordering. Of course this is something which stuff like SACK *begins* to address, it is a scenario more common in satellite networks. However you want next-hop selection based on the "laddr" for a socket which is a different thing. The stack doesn't do this on its own, it needs help from packet filtering code. You should be able to achieve this using "route-to" rules in IPFW or PF, there are tutorials out there on the subject. cheers BMS