From Fedora Project Wiki
Description
This test case ensures that the firewalld
service, which provides dynamic firewall management, is functioning correctly alongside the provided filesystem configuration from firewalld-filesystem
.
Setup
- Ensure that
firewalld
andfirewalld-filesystem
packages are installed. If not, install them with the command:sudo dnf install firewalld firewalld-filesystem
- Start the firewalld service with:
sudo systemctl start firewalld
How to test
- Check the status of firewalld: sudo firewall-cmd --state
- List the default zones:
sudo firewall-cmd --get-default-zone
- Add an example service to the default zone, for instance:
sudo firewall-cmd --add-service=http
- Reload firewalld to apply changes:
sudo firewall-cmd --reload
- Verify that the service is added:
sudo firewall-cmd --list-services
- Remove the added service:
sudo firewall-cmd --remove-service=http
- Reload firewalld to apply changes:
sudo firewall-cmd --reload
- Verify that the service is removed:
sudo firewall-cmd --list-services
Expected Results
- The first command should indicate that firewalld is running.
- The second command should list the default zone (e.g., public).
- After adding the service, the verification command should list the "http" service in the active zone.
- After removing the service, the "http" service should no longer be listed for the active zone.