Firewalld is a firewall management tool used on Linux operating systems. Here’s a basic guide on how to use Firewalld:
- Check the Firewalld Status: First, you need to check the status of Firewalld using the following command:
sudo systemctl status firewalld
- Start and Enable Firewalld: If Firewalld is not running, start it using the following command:
sudo systemctl start firewalld
To ensure that Firewalld starts automatically on system boot, enable it using the following command:
sudo systemctl enable firewalld
- Check the Default Zone: Firewalld uses zones to control network access. You can check the default zone using the following command:
sudo firewall-cmd --get-default-zone
- List the Available Zones: To view the available zones, run the following command:
sudo firewall-cmd --get-zones
- Add Services to Zones: You can allow access to specific services by adding them to a zone. For example, to allow HTTP access, run the following command:
sudo firewall-cmd --zone=public --add-service=http --permanent
Note: The –permanent option makes the rule permanent across system reboots.
- Reload Firewalld: After adding or modifying rules, you need to reload Firewalld using the following command:
sudo firewall-cmd --reload
- Remove a Service from a Zone: If you need to remove a service from a zone, run the following command:
sudo firewall-cmd --zone=public --remove-service=http --permanent
Again, remember to reload Firewalld to apply the changes.
These are some basic steps to use Firewalld on Linux. Keep in mind that Firewalld offers a range of advanced features and commands that you can explore by referring to its documentation.