Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Port open at server level.

Status
Not open for further replies.

m2001331

Technical User
May 29, 2002
73
MY
Hi all,

How to check if a port is open at server level? How to know what ports are open - can i check that information from my server(Aix 4.3.x)?

appreciate your answers.

thanks.
 
netstat -an | egrep '^(udp|tcp.*LISTEN)'

Will show both udp and tcp ports. Drop the 'n' from the netstat to see names for hosts and services, rather than numbers, if available.

Some of the udp ports will be related to specific sessions, like ssh connections, but there's no way to weed them out of the netstat output (they don't have an equivalent to the tcp "LISTEN" that is listed.)

If you have lsof installed, you can see exactly what processes are listening, and where, with:

lsof -i -n -P| egrep '(UDP|TCP.*LISTEN)'

Remove the "-n -P" to see translated hostnames and ports, respectively.








Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top