Search code examples
centoscentos7firewalld

firewalld change default target


From firewalld man page:

–permanent [–zone=zone] --set-target=target Set the target of a permanent zone. target is one of: default, ACCEPT, DROP, REJECT

The default target is REJECT. Is it possible to change the default target to DROP? If not, why does a default option exist if it is always REJECT?

I am using CentOS 7.4

I understand that I can configure firewalld any way I'd like without being able to change the default target, but I'd like to know how to change it if possible.


Solution

  • It is not possible to change the default target - it's hardcoded. It's possible "default" was included so we could potentially introduce a "--set-default-target" option in the future, but I'm just speculating.

    https://github.com/firewalld/firewalld/issues/252