Configure a default zone with firewalld

This is not meant as a full primer for firewalld. It is just meant to document changing the default zone.

If you are looking for a more in-depth exposure to firewalld try https://www.hogarthuk.com/?q=node/9

Check available zones

firewall-cmd --get-zones

Check active zone

firewall-cmd --get-active-zones

Get current zone of interface (assumes it is in the public zone)

firewall-cmd --get-zone-of-interface=<interface returned from above output>

Check internal zone for existing services

firewall-cmd --zone=internal --list-services

Change default zone to the Internal zone

firewall-cmd --set-default-zone=internal

Make change permanent after system restart

firewall-cmd --permanent --zone=internal --change-interface=<Returned Interface>

Make change immediately

firewall-cmd --zone=internal --change-interface=<Returned Interface>

Get current zone of interface

firewall-cmd --get-zone-of-interface=<Returned Interface>

Reload the current firewall config

firewall-cmd --reload

Check the interface and verify the services

firewall-cmd --zone=internal --list-services

You must be logged in to post a comment.

Proudly powered by WordPress   Premium Style Theme by www.gopiplus.com