Networking :: How do you check a network port is open?



I'm trying to open up a network port in order to scan over the network. I added the following:

/etc/sources
sane-port          6566/tcp      # SANE network scanner daemon

/etc/inetd.conf
sane-port  stream  tcp  nowait  dsl.staff  /opt/hplip/sbin/saned saned

and then restarted /etc/init.d/inetd. So far things don't seem to be working - is there a way to check that the port is open from the same machine or another machine on the network? By telnet maybe?

Does
by name:

# netstat -al  

by number

# netstat -nl  

help?

You could either try to telnet to that port from another machine, or just do a portscan..
Thanks
Code Sample
$ netstat -at
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:bootpc                *:*                     LISTEN    
tcp        0      0 *:swat                  *:*                     LISTEN    
tcp        0      0 *:time                  *:*                     LISTEN    
tcp        0      0 *:sane                  *:*                     LISTEN    
tcp        0      0 *:discard               *:*                     LISTEN    
tcp        0      0 *:vboxd                 *:*                     LISTEN    
tcp        0      0 *:daytime               *:*                     LISTEN    
tcp        0      0 *:ipp                   *:*                     LISTEN    
Looks promising.

But:
Code Sample
$ telnet localhost 6566
Trying 127.0.0.1...
Connected to box.
Escape character is '^]'.
Connection closed by foreign host.
albeit from the same machine.

and:
Code Sample
c: telnet \192.168.1.100 6566
...could not open connection to the host, on port 6566: Connect failed
from an xp machine, didn't look so promising.

Maybe this is an issue of user permissions?

..Or a firewall.. But if a port is open, telnetting to it will work, even from XP.
For fun try "telnet google.com 80" and see what happens (if you wanna pretend to be a web browser, type "GET / HTTP/1.0" without the quotes and you'll see google front page get loaded)

Next Page...
original here.