1837509 Members
3741 Online
110117 Solutions
New Discussion

Re: open port & netstat

 
VERDAVAINNE
New Member

open port & netstat

Hello,

i need to know if port 3290 is open on my server for others. The following command returns nothing :
# netstat -an|grep 329

Is that meaning that the port is not open or that during the command request there is no communication on this port ?

by open, I mean someone can connect on.
thanks for help
7 REPLIES 7
Dave Hutton
Honored Contributor

Re: open port & netstat

Can also try lsof if you have it on your server.

There are also a few different port scanners you can download too. Like knocker, and I believe nmap will do more then just one server. But I thought you could also do it against just 1.

And another way, which may show. Is just telnet host 329 and see if you get a connection denied.

Hopefully theres no firewalls between you and the server.
VERDAVAINNE
New Member

Re: open port & netstat

thks for this quick answer.
But I though lsof was to see open files and I want to see open port on my server.
if the netstat does not answer, is that the port is not open ?

Unfortunatly I think I have firewalls ...
Dave Hutton
Honored Contributor

Re: open port & netstat

It'll show ports.
alcatraz:root /opt/OV/logs # lsof -i | grep -e LISTEN | grep 5060
mad 11841 root 7u IPv4 0xe0000001757a9580 0t0 TCP *:5060 (LISTEN)

Court Campbell
Honored Contributor

Re: open port & netstat

you can use lsof to see open ports also.

# lsof -i | grep
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
VERDAVAINNE
New Member

Re: open port & netstat

ok so how can I get lsof tool to install it on my hp server ?
Court Campbell
Honored Contributor

Re: open port & netstat

Do we need to hold you hand?

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.78/
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Ralph Grothe
Honored Contributor

Re: open port & netstat

For this to confirm you don't need lsof
(though it's nice to have)
Your void grep already showed you that there is no listening socket at this port.

You could also run

$ netstat -an|awk '$4~/\.3290$/&&$NF=="LISTEN"'

Your telnet to this port thus should get a "connection refused",
or in protocol parlance your host's tcp stack should answer with an ACK/RST set segment.
Madness, thy name is system administration