Firewalld
Cheatsheet
1. Install Firewalld
Ensure Firewalld is installed and running on your system.
2. Manage Firewalld Service
Start, enable, stop, or disable the Firewalld service.
3. Configure Zones
Define and manage zones to control the trust level of network connections.
4. Manage Services
Allow, deny, or customize services in zones.
5. Manage Ports
Open or close specific ports in zones.
6. Manage Interfaces
Assign network interfaces to zones.
7. Manage Sources
Assign specific IP addresses or subnets to zones.
8. Manage ICMP Blocks
Allow or deny ICMP messages in zones.
9. Manage Masquerading and Port Forwarding
Configure NAT and port forwarding.
10. Manage Rich Rules
20 Real Examples for Hardening with Firewalld
1. Install Firewalld
2. Start and Enable Firewalld
3. Get Active Zone
4. Change Default Zonesudo firewall-cmd --set-default-zone=home
5. Add Service to Zone
6. Remove Service from Zone
7. Add Port to Zone
8. Remove Port from Zone
9. Reload Firewalld
10. Add Interface to Zone
11. Add Source to Zone
12. Enable Masquerading
13. Add Forward Port
14. Add ICMP Block
15. Create Custom Service
Define a custom service XML file and place it in
/etc/firewalld/services/
.
16. Add Custom Service to Zone
17. Add Rich Rule
18. Remove Rich Rule
19. Query Service in Zone
20. List All Configurations
Last updated