From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,eda29bddbfcb350c X-Google-Attributes: gidfee84,public X-Google-Thread: 1020c6,eda29bddbfcb350c X-Google-Attributes: gid1020c6,public X-Google-Thread: 11035d,eda29bddbfcb350c X-Google-Attributes: gid11035d,public X-Google-Thread: 11035b,c9d1de14a09fad4f X-Google-Attributes: gid11035b,public X-Google-Thread: 10650a,eda29bddbfcb350c X-Google-Attributes: gid10650a,public X-Google-Thread: f72b0,eda29bddbfcb350c X-Google-Attributes: gidf72b0,public From: Yar Tikhiy Subject: Re: IP aliasing & telnet Date: 1998/05/18 Message-ID: <6jp30l$dg$1@alpha2.radio-msu.net>#1/1 X-Deja-AN: 354247844 References: <355B4B97.1388DC9B@cisco.com> <6jhn36$hfq$1@alpha2.radio-msu.net> Distribution: inet Organization: Radio-MSU NOC, Moscow State University Newsgroups: comp.unix.internals,comp.unix.misc,comp.unix.osf.osf1,comp.unix.solaris,comp.unix.admin,comp.unix.programmers In comp.unix.internals Bruce J. Keeler wrote: > As I read the original question, he seems to be wondering how the system > chooses the source IP address when initiating an outbound connection. > The answer is that it will pick the one that corresponds to the subnet > it's going to. The only times that's ambiguous is when there is more > than one route to the destination, or when the aliased IP addresses are > on the same subnet. I can't imagine a case when either situation would > cause a problem. AFAIK, the case of two routes to the same dst is not relevant here, because the IP output routine (e.g. BSD ip_output() ) is always told only about one specific route. It has never to choose between two routes. And it is ip_output() which sets the src address if it's INADDR_ANY. In case of two aliases on the same subnet the system seems to choose 'logicaly first' one, e.g. the address of le0 on Solaris and the first element of the interface address list on BSD. > If telnet provides no way to bind the client end of the connection, it's > probably because there's no need. Yes, I also think there is no need of letting lusers mess with source addresses :-) However, sometimes it is desirable to make non-user-end apps like innfeed or Squid which do outgoing connections use some specific source address. Of course, the apps just call bind() before connect() to achieve the effect. I think they usually set the port number to zero when calling bind() and let the system choose it itself. SY, Yar