HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

free ports

 
himacs
Super Advisor

free ports

Hi,

I want to know free ports available in the server.How can i check the same using /etc/services and netstat.
I heard that lsof can be used to list the free ports..what is the exact command used..

Regards
himacs
4 REPLIES
Horia Chirculescu
Honored Contributor

Re: free ports

Actually, you can find the open ports (using netstat -a). By negating that list you would actually find the "free" /unused ports.

Read:

http://www.iana.org/assignments/port-numbers

Best regards,
Horia.
Best regards from Romania,
Horia.
Sunil Sharma_1
Honored Contributor

Re: free ports

Hi

`netstat -a' gives you a list of used TCP/UDP ports. All others are
free.
To use (bind to) ports below 1024 you must run as root. Port
address is 2-bytes in length.

Sunil

*** Dream as if you'll live forever. Live as if you'll die today ***
himacs
Super Advisor

Re: free ports

Hi Horia,

Thanks for the reply..

netstat -a shows port status as listen,established and time_out

what will be the status for free ports..

regards
himacs
Horia Chirculescu
Honored Contributor

Re: free ports

Hello,

>what will be the status for free ports..

The "free" ports would not be listed at all.

Unused will be more appropriate.

Best regards
Horia.

Best regards from Romania,
Horia.