I'm trying top open a port on my CentOS machine:I edit the /etc/sysconfig/iptables file and add my rule:-A INPUT -p TCP -m state --state NEW -m tcp --dport 143 -j ACCEPTThen I restart the iptable service # service iptables restartBut when I'm checking the open ports the one I declared doesn't appearnetstat -tulpn | less
Open a port in my CentOS
centos;iptables;netstat
Is there a service running on that port after you've opened it? The command netstat -tulpn | less will only show you the ports of daemons that are actually listening on TCP ports.ExampleNothing's initially running:$ sudo netstat -tulpn | grep :80$Start up Apache:$ sudo /etc/init.d/httpd startStarting httpd:                                            [  OK  ]$Check again:$ sudo netstat -tulpn | grep :80tcp        0      0 :::80                       :::*                        LISTEN      31260/httpd    Now we see it. Stop the service:$ sudo /etc/init.d/httpd stopStopping httpd:                                            [  OK  ]$Now it's gone again.$ sudo netstat -tulpn | grep :80$ 