...
Code Block |
---|
# systemctl enable firewalld # systemctl start firewalld # systemctl status firewalld |
To open an incoming connection to a specific service such as SSH, you need to verify that the service is present in the firewalld rules and, then, add the rule for the service by adding --permanent switch to commands as below
Code Block |
---|
# firewall-cmd --add-service=[tab] #List services
# firewall-cmd --add-service=ssh
# firewall-cmd --add-service=ssh --permanent |
If you wish to open incoming connections to other network services such as HTTP or SMTP, just add the rules as shown by specifying the service name.
Code Block |
---|
# firewall-cmd --permanent --add-service=http
# firewall-cmd --permanent --add-service=https
# firewall-cmd --permanent --add-service=smtp |
To view all firewall rules on the server, run the following command.
Code Block |
---|
# firewall-cmd --permanent --list-all |