From owner-freebsd-questions Fri Jul 13 6:57:51 2001 Delivered-To: freebsd-questions@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 4316837B401 for ; Fri, 13 Jul 2001 06:57:44 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f6DDv2I88691; Fri, 13 Jul 2001 16:57:02 +0300 (EEST) (envelope-from ru) Date: Fri, 13 Jul 2001 16:57:02 +0300 From: Ruslan Ermilov To: Tao Huang Cc: FreeBSD Subject: Re: A question about how kernel choose the IP! Message-ID: <20010713165702.C87098@sunbay.com> Mail-Followup-To: Tao Huang , FreeBSD References: <37CF5555FE9@broadstone.shef.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <37CF5555FE9@broadstone.shef.ac.uk>; from m0th@dcs.shef.ac.uk on Fri, Jul 13, 2001 at 12:46:30PM -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jul 13, 2001 at 12:46:30PM -0800, Tao Huang wrote: > I have a question that how kernel choose the IP if there are more than one IP alias to one adaptor card? > > I try several test as follow. > > CASE 1: > ifconfig xl0 inet 192.168.1.2 netmask 255.255.255.0 > ifconfig xl0 inet 192.168.1.3 netmask 255.255.255.255 alias > route -n add -net 0 192.168.1.1 > > I found that the kernel choose 192.168.1.2 as the source IP for communication > > CASE 2: > ifconfig xl0 inet 192.168.2.2 netmask 255.255.255.0 > ifconfig xl0 inet 192.168.1.3 netmask 255.255.255.0 alias > route -n add -net 0 192.168.1.1 > > in this case, i found the kernel choose 192.168.1.3 as the source IP for communication. > > So, how does the kernel choose the source IP???????????? > Try that: route -vn get . Cheers, -- 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-questions" in the body of the message