To enable the firewall in Red Hat Enterprise Linux (RHEL), you typically use the firewalld
service. Here are the steps to enable the firewall:
-
Check if firewalld is installed: Before enabling the firewall, ensure that the
firewalld
package is installed on your system. You can check this by running the following command in the terminal:rpm -q firewalld
If
firewalld
is installed, you'll see its version information. If it's not installed, you can install it using the package manager (yum
ordnf
). -
Start the firewalld service: If
firewalld
is installed but not running, you need to start the service. Use the following command to start thefirewalld
service:sudo systemctl start firewalld
-
Enable the firewalld service to start on boot: To ensure that
firewalld
starts automatically at system boot, enable the service using the following command:sudo systemctl enable firewalld
-
Check the status of firewalld: You can verify that
firewalld
is running and enabled by checking its status:sudo systemctl status firewalld
This command will show you whether
firewalld
is active (running) and whether it's set to start automatically at boot.
Once you've completed these steps, the firewall provided by firewalld
should be enabled on your RHEL system. You can then proceed to configure firewall rules based on your specific requirements using tools like firewall-cmd
or graphical utilities like firewall-config
.