Open ports on UNIX

Hi,
 I would like to know which command to use to know the port information on a UNIX Box and I would like to know about the open ports and closed ports.
Thanks
Koppcha
LVL 8
koppchaAsked:
Who is Participating?
 
PsiCopCommented:
If you want to see what ports are currently in use, the command is --> netstat -a

Opening a port via IP tables merely makes it accessible. There has to be something listening on it.
0
 
kcarrimCommented:
Redhat 7.2 sets up an iptables-based firewall for you automatically during installation. To open a tcp port use something like:

iptables -A INPUT -s <source-ip/wildcard> -p tcp -m tcp --dport <port-number> -j ACCEPT

http://unixhelp.ed.ac.uk/CGI/man-cgi?iptables
0
 
brettmjohnsonCommented:
Try:
  netstat -ab
or
  netstat -a
if your unix distribution's netstat does not support the -b option.
0
 
rindiCommented:
iptables --list

shows you which rules are setup
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.