Date: Fri, 13 Jul 2001 16:57:02 +0300 From: Ruslan Ermilov <ru@FreeBSD.ORG> To: Tao Huang <m0th@dcs.shef.ac.uk> Cc: FreeBSD <freebsd-questions@FreeBSD.ORG> Subject: Re: A question about how kernel choose the IP! Message-ID: <20010713165702.C87098@sunbay.com> In-Reply-To: <37CF5555FE9@broadstone.shef.ac.uk>; from m0th@dcs.shef.ac.uk on Fri, Jul 13, 2001 at 12:46:30PM -0800 References: <37CF5555FE9@broadstone.shef.ac.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <destination>. 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010713165702.C87098>