Once you install CentOS 7
, by default firewalld
will block almost all network traffic.
public
interfaces: eno16777728
[root@localhost firewalld]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
[root@localhost firewalld]# firewall-cmd --reload
success
In order to open ports for certain services you can easily reconfigure firewall using firewall-cmd command.
[root@localhost firewalld]# firewall-cmd --get-active-zonespublic
interfaces: eno16777728
[root@localhost firewalld]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
[root@localhost firewalld]# firewall-cmd --reload
success
Example contains port 80, however you can open any port using same method.
It is worth to check zones configured on your machine and make sure you open port in proper zone where service should be enabled.