d.
# sudo yum install firewalld -y
2. How to disable or enable Firewalld at boot :
a) To disable start at boot :
# sudo systemctl disable firewalld rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service' rm '/etc/systemd/system/basic.target.wants/firewalld.service'
b) To enable start at boot :
# sudo systemctl enable firewalld
3. Verify that firewalld is enabled and running on your server system :
# sudo systemctl status firewalld.service
# sudo systemctl status firewalld.service firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled) Active: active (running) since Wed 2015-09-09 21:26:25 MYT; 1 weeks 0 days ago Main PID: 2348 (firewalld) CGroup: /system.slice/firewalld.service ??2348 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid Sep 09 21:26:25 centos71.ehowstuff.local systemd: Started firewalld - dynamic firewall daemon.
4. How to query the current default zone ?
# sudo firewall-cmd --get-default-zone public
In this case, the default zone is public.
5. How to list all available zones ?
# sudo firewall-cmd --get-zones block dmz drop external home internal public trusted work
This will display all available zones.
6. Open up incoming http,https and mysql traffic for public zone :
# sudo firewall-cmd --permanent --zone=public --add-service=http # sudo firewall-cmd --permanent --zone=public --add-service=https # sudo firewall-cmd --permanent --zone=public --add-service=mysql
7. Activate the changes to your server firewall :
# sudo firewall-cmd --reload
8. Check the configuration of the running firewall on your system :
a) Query active zone :
# sudo firewall-cmd --get-active-zones
b) Display all running firewall configuration :
# sudo firewall-cmd --zone=public --list-all
# sudo firewall-cmd --zone=public --list-all public (default, active) interfaces: ens32 sources: services: dhcpv6-client http https mysql ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules:
I hope that this gives you some ideas and essential guidance on how to configure firewalld in linux RHEL 7 / CentOS 7.