Link to home
Start Free TrialLog in
Avatar of koppcha
koppchaFlag for United States of America

asked on

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
Avatar of kcarrim
kcarrim

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
ASKER CERTIFIED SOLUTION
Avatar of PsiCop
PsiCop
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try:
  netstat -ab
or
  netstat -a
if your unix distribution's netstat does not support the -b option.
iptables --list

shows you which rules are setup