How to check all the Linux ports that are opened in Centos / RedHat
In this article we will see how to check all the Linux ports that are opened in Centos / RedHat. If you want to open or close a port for a Linux firewall you have to edit the rules in the iptables configuration. By default iptables firewall stores its configuration at etc/sysconfig/iptables file. You need to edit this file and add rules to open port.
This task should be a known task by any sysadmins, and is the base for understanding the security rules around your system.
Here are the steps to open the port 12345 using the default visual editor vim:
Open port 12345
Open flle /etc/sysconfig/iptables:
Append rule as follows:
Save and close the file. Restart iptables:
Verify that port is open
Run following command:
Make sure iptables is allowing port connections: