Powered by Drupal

Common firewall-cmd Examples

List all zones:

 firewall-cmd --list-all-zones

List all active zones:

firewall-cmd --get-active-zone

To add a host or network to allow all connections from:

firewall-cmd --permanent --zone=trusted --add-source=10.10.10.10

Add a service to be allowed from anywhere:

firewall-cmd --permanent --add-service=smtp

When you run firewall-cmd with the "--permanent" it will not be active until the dameon is reloaded. Do the following to make them active:

firewall-cmd --reload
Category: