firewall-cmd Command Examples

The firewalld command-line client. View and adapt the runtime or permanent firewall configuration state. More information: https://firewalld.org/documentation/man-pages/firewall-cmd.

firewall-cmd --list-all-zones

firewall-cmd --permanent --zone={{block}} --change-interface={{enp1s0}}

firewall-cmd --permanent --zone={{public}} --add-service={{https}}

firewall-cmd --permanent --zone={{public}} --remove-service={{http}}

firewall-cmd --permanent --zone={{public}} --add-rich-rule='rule family="{{ipv4|ipv6}}" forward-port port="{{443}}" protocol="{{udp|tcp}}" to-port="{{8443}}"'

firewall-cmd --reload

firewall-cmd --runtime-to-permanent

firewall-cmd --panic-on