Tips & Tricks : CentOS firewalld : open port

Datetime:2016-08-22 23:42:40          Topic: Centos           Share

Once you install CentOS 7 , by default firewalld will block almost all network traffic.

In order to open ports for certain services you can easily reconfigure firewall using firewall-cmd command.

[root@localhost firewalld]# firewall-cmd --get-active-zones
public
  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.





About List