FirewallD is a dynamic firewall manager for Linux systems that provides a command-line interface and a D-Bus interface for controlling and managing firewall rules. Here are the steps to set up a firewall using FirewallD on OpenSUSE Linux:
- Open a terminal window and log in as the root user or use the
sudo
command to run the following commands. - Install the FirewallD package by using the
zypper
command.
zypper install firewalld
- Start the FirewallD service and enable it to start automatically at boot time
systemctl start firewalld
systemctl enable firewalld
- To check the status of the firewall, use the command:
firewall-cmd --state
- To configure the firewall and add rules, you can use the
firewall-cmd
command. for example to open port 80 for incoming traffic:
firewall-cmd --permanent --add-port=80/tcp
- To list the current firewall rules, use the command:
firewall-cmd --list-all
- To reload the firewall and apply the changes:
firewall-cmd --reload
- To check the status of a specific service, you can use the
--list-services
option. For example, to check if the HTTP service is enabled:
firewall-cmd --list-services --permanent
- To enable a service, you can use the
--add-service
option. For example, to enable the HTTP service:
firewall-cmd --add-service=http --permanent
- To disable a service, you can use the
--remove-service
option. For example, to disable the HTTP service:
firewall-cmd --remove-service=http --permanent
These are the basic steps to set up a firewall using FirewallD on OpenSUSE Linux. Remember to always keep your firewall updated and configure it accordingly to your needs.