From owner-freebsd-questions@FreeBSD.ORG Wed Apr 23 02:36:50 2003 Return-Path: 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 9AD2037B401 for ; Wed, 23 Apr 2003 02:36:50 -0700 (PDT) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 1BDF243FD7 for ; Wed, 23 Apr 2003 02:36:49 -0700 (PDT) (envelope-from dinesh@alphaque.com) Received: (qmail 15667 invoked by uid 0); 23 Apr 2003 09:36:46 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 23 Apr 2003 09:36:46 -0000 Received: from localhost (localhost [127.0.0.1]) by prophet.alphaque.com (8.12.9/8.12.3) with ESMTP id h3N9Z2Aw046519; Wed, 23 Apr 2003 17:35:02 +0800 (MYT) (envelope-from dinesh@alphaque.com) Date: Wed, 23 Apr 2003 17:35:02 +0800 (MYT) From: Dinesh Nair To: Jonathan In-Reply-To: <004301c30941$81be6a50$3aaa9bd9@workstation> Message-ID: <20030423173033.O37825-100000@prophet.alphaque.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-questions@freebsd.org Subject: Re: Routing through two networks X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 09:36:50 -0000 On Wed, 23 Apr 2003, Jonathan wrote: > All I'm trying to do is ensure that any traffic that comes in for > 193.0.0.250 routes back out through 193.0.0.1 and anything that comes in > for 217.0.0.250 routes back out through 217.0.0.1 keeping bandwidth > charges to a minimum. it's interesting that you're asking the very same question i asked on this list yesterday. i had the same problem, where i wanted traffic incoming on one interface to go out the same on a dual homed box. playing around with ipfw's fwd directive, i came to the following solution. set the default route to the router on one interface, say a default route to 193.0.0.1. then add the following ipfw rule ipfw fwd 217.0.0.1 ip from 217.0.0.250 to any this way, traffic which is outgoing from 217.0.0.250 will hit the forward rule and be sent on a next hop of 217.0.0.1, while all other traffic will obey the default rule and go out with a next hop 193.0.0.1. this works for me, but my question was if this is the optimum way of solving this problem. Regards, /\_/\ "All dogs go to heaven." dinesh@alphaque.com (0 0) http://www.alphaque.com/ +==========================----oOO--(_)--OOo----==========================+ | for a in past present future; do | | for b in clients employers associates relatives neighbours pets; do | | echo "The opinions here in no way reflect the opinions of my $a $b." | | done; done | +=========================================================================+