Introduction
OpenSUSE is a popular open-source operating system that is widely used by individuals and organizations. With the increase in cyber threats and attacks, it is essential to secure your OpenSUSE system using a firewall. A firewall is a software or hardware device that is designed to prevent unauthorized access to or from a private network. It acts as a barrier between your network and the internet, filtering out unwanted traffic and protecting your system from potential security threats.
In this article, we will discuss how to secure and configure the OpenSUSE system with a firewall.
Prerequisites
- A root or non-root user with
sudo
privileges.
Installing the Firewall
OpenSUSE comes with two firewall options: iptables and firewalld. iptables is a command-line interface (CLI) firewall, whereas firewalld is a graphical user interface (GUI) firewall. In this article, we will be using firewalld.
-
To install firewalld on your OpenSUSE system, open the terminal and enter the following command.
$ sudo zypper update
$ sudo zypper -y install firewalld -
After installing the firewall software, the next step is to start the firewall service.
$ sudo systemctl start firewalld
$ sudo systemctl enable firewalld -
Check the status of the firewall.
$ sudo systemctl status firewalld
Configuring the Firewall Rules
The firewall rules are used to specify which traffic is allowed or denied by the firewall. You can use the firewalld CLI or GUI to configure the firewall rules.
-
Here are some basic CLI commands to configure the firewall rules.
-
To list the current firewall rules.
$ sudo firewall-cmd --list-all
-
To allow incoming traffic for a specific service (e.g., ssh).
$ sudo firewall-cmd --add-service=ssh --permanent
-
To allow incoming traffic for a specific port (e.g., port 80).
$ sudo firewall-cmd --add-port=80/tcp --permanent
-
To reload the firewall rules.
$ sudo firewall-cmd --reload
-
To list the current firewall rules.