Controlling the firewalld Service
In Oracle Linux 9, the firewall service,
firewalld
, is enabled by default. The service is controlled by the
systemctl command.
To start the service:
sudo systemctl unmask firewalld
sudo systemctl start firewalld
To ensure that the service starts automatically when the system starts, run the following command after starting the firewall:
sudo systemctl enable firewalld
To stop the firewall service and prevent it from automatically starting when the system starts, run the following command:
sudo systemctl stop firewalld
sudo systemctl disable firewalld
To prevent the firewall service from being started by other
services or through the firewalld
D-Bus
interface, run the following command after disabling the
firewall:
sudo systemctl mask firewalld
To display the current status of the firewall service:
sudo systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2022-05-05 08:41:36 GMT; 5 days ago Docs: man:firewalld(1) Main PID: 1155 (firewalld) Tasks: 4 (limit: 93659) Memory: 32.5M CPU: 1.438s CGroup: /system.slice/firewalld.service └─1155 /usr/bin/python3 -s /usr/sbin/firewalld --nofork --nopid