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
firewalldpackage is installed on your system. You can check this by running the following command in the terminal:rpm -q firewalld
If
firewalldis installed, you'll see its version information. If it's not installed, you can install it using the package manager (yumordnf). -
Start the firewalld service: If
firewalldis installed but not running, you need to start the service. Use the following command to start thefirewalldservice:sudo systemctl start firewalld
-
Enable the firewalld service to start on boot: To ensure that
firewalldstarts automatically at system boot, enable the service using the following command:sudo systemctl enable firewalld
-
Check the status of firewalld: You can verify that
firewalldis running and enabled by checking its status:sudo systemctl status firewalld
This command will show you whether
firewalldis 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.
