firewall centos code example
Example 1: firewall-cmd add port 8080
sudo firewall-cmd --zone=public --permanent --add-port=5000/tcp
sudo firewall-cmd --zone=public --permanent --add-port=4990-4999/udp
sudo firewall-cmd --zone=public --permanent --list-ports
Example 2: install firewall-cmd centos 7
sudo yum install firewalld
sudo systemctl enable firewalld
sudo reboot
Example 3: is firewall running centos 7
systemctl status firewalld
Example 4: firewall cmd add zone
firewall-cmd --permanent --new-zone [zone]