From owner-freebsd-net Tue Oct 24 1:43:37 2000 Delivered-To: freebsd-net@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 4751137B479 for ; Tue, 24 Oct 2000 01:43:29 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.0/8.11.0) id e9O8fsV68549; Tue, 24 Oct 2000 11:41:54 +0300 (EEST) (envelope-from ru) Date: Tue, 24 Oct 2000 11:41:54 +0300 From: Ruslan Ermilov To: Mike Nowlin Cc: freebsd-net@FreeBSD.ORG Subject: Re: src IP addr w/multiple ifaces Message-ID: <20001024114154.B67369@sunbay.com> Mail-Followup-To: Mike Nowlin , freebsd-net@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mike@argos.org on Tue, Oct 24, 2000 at 02:39:54AM -0400 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, Oct 24, 2000 at 02:39:54AM -0400, Mike Nowlin wrote: > > I have a system here that has four different ethernet interfaces (dc0, > dc1, dc2, and fxp0), each on a different IP address: > > dc0 10.220.134.162/30 <-- Link to outside world > dc1 1.2.3.4/27 <-- Subnet assigned by my ISP > dc2 10.98.1.1/16 > fxp0 10.97.1.1/16 > > The machines "assigned" IP is the 1.2.3.4 addr, but anytime I try > and make an outgoing connection, it uses a src IP of 10.220.134.162, not > 1.2.3.4. (We had to do it this way so that the ISP could route the /27 > block via 10.220.134.162.) > > How is this source IP chosen in the kernel - by order of > interfaces? (The order listed above is the order probed during > bootup.) Is there any way to force it to use the 1.2.3.4 addr instead of > 10.220.134.162? I imagine I could figure it out with NATD, but I see that > as being a little ugly... > See the output of the "route -vn get default" command, it will show you the IFP (interface pointer), and IFA (interface address). If you would have the 1.2.3.4 as an alias address on the dc0 interface, you could change it with "route change default -ifa 1.2.3.4". But you happen to have it on dc1. -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message