On Mon, Jan 3, 2011 at 02:42, Minh Van Le <[email protected]> wrote:
> On Sun, 2011-01-02 at 00:04 +1100, Zenaan Harkness wrote:
>> On Sat, Jan 1, 2011 at 17:26, Minh Van Le <[email protected]> wrote:
>> > How do I establish a connection where the localhost IP are both in the
>> > "Local Address" and "Foreign Address" columns of netstat ?
>> >
>> > Eg.,
>> >
>> > =============================================================================================
>> > [r...@j8 xinetd.d]# netstat -A inet -n
>> > Active Internet connections (w/o servers)
>> > Proto Recv-Q Send-Q Local Address               Foreign Address
>> > State
>> > tcp        0      0 192.168.1.8:57246           192.168.1.8:6667
>> > ESTABLISHED
>> > =============================================================================================
>> >
>> > (where "192.168.1.8" is my localhost's IP address).
>> >
>> > The reason I want to do this is because I want to test my authd (ident
>> > server) after installing the package in Fedora 13.
>> > "/usr/share/doc/authd-1.4.3/README.html" says:
>> >
>> > =============================================================================================
>> > Testing
>> >
>> >     2. Run "netstat -A inet -n" and find an established tcp
>> >        connection.
>> >     3. Input the two ports prefixed with colons as single command line
>> >        argument (no whitespace unless the entire pair is enclosed in
>> >        quotes for the command line parser), in the same order,
>> >        separated by a comma. Example:
>> >
>> >        $ /usr/sbin/in.inetd 33201,6667
>> >
>> >     4. Execute "telnet localhost auth" and type the two ports separated
>> >        by a comma. The two ports selected must have a foreign address
>> >        of localhost, or 127.0.0.1 as well as a matching local address.
>> >        If they do not, a NO-USER error will be returned.
>> >
>> > =============================================================================================
>> >
>> > But I can't seem to get a port pair for localhost.
>>
>> You have not included the commands you've run and their output. Eg,
>> did you try the telnet command, if so, what was your error message or
>> output/ result?
>>
>> Eg if you are running an apache server on port 80, you could run:
>>
>> In terminal 1 (don't exit the telnet command):
>> $ telnet localhost 80
>> Trying 127.0.0.1...
>> Connected to localhost.
>> Escape character is '^]'.
>>
>>
>> Now in terminal 2:
>> $ netstat -A inet -n
>> Active Internet connections (w/o servers)
>> Proto Recv-Q Send-Q Local Address           Foreign Address         State
>> tcp        0      0 127.0.0.1:80            127.0.0.1:47597         SYN_RECV
>> tcp        0      0 127.0.0.1:47597         127.0.0.1:80            
>> ESTABLISHED
>>
>>
>> As you can see, netstat gives me the last line above.
>>
>> Is that what you want?
>
> I'm just running "telnet localhost 113":
>
> =============================================================================================
> [02:24:37 mva...@j8 ~]$ telnet localhost 113
> Trying ::1...
> Connected to localhost.
> Escape character is '^]'.
> =============================================================================================
>
> and while the connection is still open, in terminal 2:
>
> =============================================================================================
> [02:23:11 mva...@j8 ~]$ netstat -A inet -n
> Active Internet connections (w/o servers)
> Proto Recv-Q Send-Q Local Address               Foreign Address             
> State
> tcp        0      0 192.168.1.8:36866           195.234.39.129:443          
> ESTABLISHED
> tcp        0      0 192.168.1.8:34467           82.96.64.4:6667             
> ESTABLISHED
> tcp        0      0 192.168.1.8:35957           202.7.177.43:80             
> ESTABLISHED
> =============================================================================================
>
> As you can see, it does not appear to show any localhost connections in 
> netstat's Foreign Address column.

Post the output of "ifconfig".

Also man telnet gives the following (although that's for source/local,
not foreign, address:
     -b address
             Use bind(2) on the local socket to bind it to a specific local
             address.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to