首頁  >  文章  >  系統教程  >  Redhat 7 Linux 系統防火牆:啟用、停用與狀態檢查

Redhat 7 Linux 系統防火牆:啟用、停用與狀態檢查

PHPz
PHPz原創
2024-07-24 15:43:231066瀏覽

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

怎樣在Redhat7Linux系統上停止/啟動和停用/啟用防火牆

Redhat7Linux系統上的防火牆預設為啟用。一般不須要停用防火牆linux防火牆開機啟動,但它可能十分便捷用於測試目的等。在Redhat7Linux系統上,防火牆以firewalld守護程式運作。 Bellow指令可用於偵測防火牆狀態:

[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.

從前面的輸出我們可以看見防火牆已啟用,這意味著它將在重新啟動後手動啟動,但是當前也是活動的。據悉,您甚至可以使用以下方式檢測所有目前應用的規則:

[root@rhel7 ~]# iptables-save

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

停止並啟動RHEL7防火牆

Redhat7Linux系統上的防火牆可以透過以下linux指令停止:

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

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

系統重新啟動後,停止的防火牆將再度啟動。若要在Redhat7Linux系統上啟動防火牆linux防火牆開機啟動RAR FOR LINUXlinux系統下載,請使用:

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

停用與啟用RHEL7防火牆

為了完全停用RHEL7防火牆,所以在重新啟動後運行不會載入:

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

如今,系統重新啟動後防火牆未能啟動。要再次啟用防火牆:

[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'

以上是Redhat 7 Linux 系統防火牆:啟用、停用與狀態檢查的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn