2015-01-12 18:45:34 +03:00
|
|
|
# firewall-cmd
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
> The firewalld command line client.
|
2015-01-12 18:45:34 +03:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- View the available firewall zones:
|
2015-01-12 18:45:34 +03:00
|
|
|
|
|
|
|
`firewall-cmd --get-active-zones`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- View the rules which are currently applied:
|
2015-01-12 18:45:34 +03:00
|
|
|
|
|
|
|
`firewall-cmd --list-all`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Permanently open the port for a service in the specified zone (like port `443` when in the `public` zone):
|
2015-01-12 18:45:34 +03:00
|
|
|
|
|
|
|
`firewall-cmd --permanent --zone={{public}} --add-service={{https}}`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Permanently close the port for a service in the specified zone (like port `80` when in the `public` zone):
|
2015-01-12 18:45:34 +03:00
|
|
|
|
|
|
|
`firewall-cmd --permanent --zone={{public}} --remove-service={{http}}`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Reload firewalld to force rule changes to take effect:
|
2015-01-12 18:45:34 +03:00
|
|
|
|
|
|
|
`firewall-cmd --reload`
|