Home > System Tutorial > Linux > body text

Redhat 7 Linux system firewall: enabling, disabling and status checking

PHPz
Release: 2024-07-24 15:43:23
Original
911 people have browsed it

Redhat 7 Linux 系统防火墙:启用、禁用与状态检查

How to stop/start and disable/enable firewall on Redhat7Linux system

The firewall on Redhat7Linux system is enabled by default. There is generally no need to disable the firewall linux firewall on boot , but it can be very convenient for testing purposes, etc. On Redhat7Linux systems, the firewall runs as the firewalld daemon. Bellow command can be used to detect firewall status:

[root@rhel7 ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
 Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
 Active: active (running) since Thu 2014-09-04 19:18:47 EST; 3 months 28 days ago
 Main PID: 539 (firewalld)
 CGroup: /system.slice/firewalld.service
 └─539 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
Sep 04 19:18:45 rhel7 systemd[1]: Starting firewalld - dynamic firewall daemon...
Sep 04 19:18:47 rhel7 systemd[1]: Started firewalld - dynamic firewall daemon.
Copy after login

From the previous output we can see that the firewall is enabled, which means it will be started manually after reboot, but is currently active. It is reported that you can even detect all currently applied rules using:

[root@rhel7 ~]# iptables-save
Copy after login

linux防火墙开机启动_防火墙开启端口linux_防火墙开机启动命令

Stop and start RHEL7 firewall

The firewall on Redhat7 Linux system can be stopped with the following linux command:

防火墙开机启动命令_防火墙开启端口linux_linux防火墙开机启动

[root@rhel7 ~]# service firewalld stop
Redirecting to /bin/systemctl stopfirewalld.service
Copy after login

After the system restarts, the stopped firewall will start again. To start the firewall on Redhat7Linux system linux firewall startup on boot RAR FOR LINUXlinux system download, please use:

[root@rhel7 ~]# service firewalld start
Redirecting to /bin/systemctl startfirewalld.service
Copy after login

Disable and enable RHEL7 firewall

To completely disable the RHEL7 firewall so running after a reboot will not load:

[root@rhel7 ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
Copy after login

Now, the firewall fails to start after system restart. To enable the firewall again:

[root@rhel7 ~]# systemctl enable firewalld
ln -s '/usr/lib/systemd/system/firewalld.service' '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
ln -s '/usr/lib/systemd/system/firewalld.service' '/etc/systemd/system/basic.target.wants/firewalld.service'
Copy after login

The above is the detailed content of Redhat 7 Linux system firewall: enabling, disabling and status checking. For more information, please follow other related articles on the PHP Chinese website!

source:itcool.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!