Date: Fri, 11 Apr 2003 00:00:12 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Sashikiran Rachakonda <sashi@cs.pdx.edu> Cc: freebsd-net@freebsd.org Subject: Re: Question Regarding IP Alias Message-ID: <20030410210012.GA84656@gothmog.gr> In-Reply-To: <Pine.GSO.4.21.0304101226530.26981-100000@sirius.cs.pdx.edu> References: <Pine.GSO.4.21.0304101226530.26981-100000@sirius.cs.pdx.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2003-04-10 12:27, Sashikiran Rachakonda <sashi@cs.pdx.edu> wrote: > > Hi,i have a question regarding the IP Alias. If i bind my interface to 2 > ip addresses say > > 1) ifconfig xl0 add w.x.y.z netmask 255.255.255.0 > 2) ifconfig xl0 add p.q.r.s netmask 255.255.0.0 > > Is there a way that i can force the packets coming-out of this > interface to have ipSrc = p.q.r.s and not w.x.y.z. My question is is > there a way that you can tell the interface to have the IPsrc set to > the one we want to, for all packets coming out of this interface. The default IP address that is used for packets that aren't explicitly set to something different is the first address of the interface, IIRC. 'First' here being something that depends heavily on the order of the ifconfig commands and the running kernel's code. Instead of relying on factors like this that you cannot control reliably, your programs should explicitly bind() a sockaddr_in structure with the p.q.r.s address. Then all outgoing packets of that socket will have the correct address. - Giorgos
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030410210012.GA84656>