From owner-freebsd-questions@FreeBSD.ORG Tue Aug 1 23:37:34 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC0E016A4DA; Tue, 1 Aug 2006 23:37:34 +0000 (UTC) (envelope-from malcolm.kay@internode.on.net) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A98D43D46; Tue, 1 Aug 2006 23:37:34 +0000 (GMT) (envelope-from malcolm.kay@internode.on.net) Received: from alpha.home (ppp150-165.lns3.adl2.internode.on.net [59.167.150.165]) by ash25e.internode.on.net (8.13.6/8.13.5) with ESMTP id k71NbWHn059428; Wed, 2 Aug 2006 09:07:32 +0930 (CST) (envelope-from malcolm.kay@internode.on.net) From: Malcolm Kay Organization: at home To: freebsd-questions@freebsd.org Date: Wed, 2 Aug 2006 09:07:31 +0930 User-Agent: KMail/1.8 References: <7956f3200607311240g740c949cvbea994374967071f@mail.gmail.com> In-Reply-To: <7956f3200607311240g740c949cvbea994374967071f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608020907.31695.malcolm.kay@internode.on.net> Cc: Joseph Gleason , questions@freebsd.org Subject: Re: multiple interfaces on same subnet? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2006 23:37:35 -0000 On Tue, 1 Aug 2006 05:10 am, Joseph Gleason wrote: > Is it possible to reach two hosts via two interfaces that are > both on the same subnet? > > Example: > em0: 172.20.0.1/16 > em1: 172.20.0.2/16 > > And I want to reach 172.20.0.3 via em0 and 172.20.0.4 via em1. > > From 'netstat -nr' I see a line like this: > 172.20/14 link#1 UC 0 0 > em0 > > This seems to say that anything on 172.20/14 should be reached > on em0. Is it possible to add a rule that says that 172.20.0.4 > should be reachable on em1? > I have no personal experience of doing this, but it seems to me you should be able to achieve your objective by using a specific netmask with ifconfig rather than the CIDR / notation: 172.20.0.1/16 -> 172.20.0.1 netmask 255.255.0.1 172.20.0.2/16 -> 172.20.0.1 netmask 255.255.0.1 Then as I understand it odd numbered addresses should be reached via 172.20.0.1 and even numbered addresses via 172.20.0.2 > I only care about the path of outbound packets. I don't care > which interface inbound traffic comes on. > > I am well aware that this is a fairly strange thing to do. > > My objective is to have a FreeBSD box balance outbound traffic > between two NICs, while being able to select from among many > routers that could be the default gateway and having the two > NICs connect to different switches for fault tolerance. (I > would do the fault tolerance via a watchdog script of some > sort) > > If it weren't for the many routers aspect, it would be > reasonable to create separate subnets. I need to be able to > select from a group of around 10 possible default gateways and > some of those routers I do not control so adding a subnet > would be trouble. I would expect that subnets in the routers would not be an issue so long as they encompass those set in ifconfig. Malcolm