How to set up a firewall using FirewallD on OpenSUSE Linux

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:

  1. Open a terminal window and log in as the root user or use the sudo command to run the following commands.
  2. Install the FirewallD package by using the zypper command.
zypper install firewalld
  1. Start the FirewallD service and enable it to start automatically at boot time
systemctl start firewalld
systemctl enable firewalld
  1. To check the status of the firewall, use the command:
firewall-cmd --state
  1. 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
  1. To list the current firewall rules, use the command:
firewall-cmd --list-all
  1. To reload the firewall and apply the changes:
firewall-cmd --reload
  1. 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
  1. To enable a service, you can use the --add-service option. For example, to enable the HTTP service:
firewall-cmd --add-service=http --permanent
  1. 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.

Leave a Comment