On Sun, 2011-01-02 at 00:04 +1100, Zenaan Harkness wrote:
> On Sat, Jan 1, 2011 at 17:26, Minh Van Le <mva...@tpg.com.au> 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.

Maybe Fedora's netstat command just doesn't show any Foreign localhost 
addresses ... or maybe I need to run Apache like you.

... anyway, I had an idea to test my authd/ident server and it was: 

1. Go to my Netcomm modem, set port forwarding for port 113 to point to 
192.168.1.8. 

2. Try logging on to any IRC server. I get "Checking Ident" and "Got Ident 
response" successfully: 

=============================================================================================
 BitchX: Auto Response is set to - mvanle
 Connecting to port 6667 of server kornbluth.freenode.net [refnum 0]
[freenode]  *** Looking up your hostname...
[freenode]  *** Checking Ident
[freenode]  *** Found your hostname
[freenode]  *** Got Ident response
=============================================================================================

So it turns out that IRC servers are making their ident requests directly to me 
on port 113 without NAT, which was why the incoming ident requests never got to 
my laptop (without port forwarding on my modem).

Not an ideal solution but tested Ok. 

Anyway, do you know why your telnet command says "Trying 127.0.0.1..." and mine 
says "Trying ::1..." ? is it something to do with ipv6 ?


-- 
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