How to configure a firewall on Fedora.
Setting up a firewall on Fedora can be achieved using the Firewalld tool. The following are the steps to set up a firewall on Fedora:
- Check if Firewalld is installed: Enter the following command in the terminal to verify if Firewalld is installed:
sudo systemctl status firewalld
- If Firewalld is not installed, you can use the following command to install it:
sudo dnf install firewalld
- Start the Firewalld service and enable it to start automatically on boot.
sudo systemctl start firewalld
sudo systemctl enable firewalld
- Check the status of Firewalld to make sure it is running.
sudo firewall-cmd --state
- Set up Firewalld rules: You can use the firewall-cmd command to add, delete, and manage firewall rules. For example, you can use the following command to allow SSH traffic:
sudo firewall-cmd --zone=public --add-service=ssh --permanent
- Reload the Firewalld configuration to apply the changes.
sudo firewall-cmd --reload
- View the list of Firewalld rules:
sudo firewall-cmd --list-all
By following the steps above, you can successfully set up a firewall on Fedora and configure rules to protect your system.