Linux關閉防火牆並設定開機啟動 不啟動

2021-08-28 06:11:11 字數 1273 閱讀 8099

檢視防火牆:

[root@cactiez ~]# service iptables status
關閉防火牆:

[root@cactiez ~]# service iptables stop
開啟防火牆:

[root@cactiez ~]# service iptables start
永久關閉防火牆:

查詢開啟iptables是否啟動

[root@cactiez ~]# chkconfig --list | grep iptables

iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off

由此可見:2/3/4/5都是開機啟動,數字代表runlevel等級

[root@cactiez ~]# chkconfig iptables off

[root@cactiez ~]# chkconfig --list | grep iptables

iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off

永久開啟防火牆:

[root@cactiez ~]# chkconfig iptables on

[root@cactiez ~]# chkconfig --list | grep iptables

iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off

檢視防火牆:

[root@cactiez ~]# systemctl status firewald.service
關閉防火牆:

[root@cactiez ~]# systemctl stop firewald.service
開啟防火牆:

[root@cactiez ~]# systemctl start firewald.service
永久關閉防火牆:

[root@cactiez ~]# systemctl disable firewald.service
永久開啟防火牆:

[root@cactiez ~]# systemctl enable firewald.service

關閉防火牆並設定開機不啟動

檢視防火牆狀態 關閉防火牆 開啟防火牆 開機不啟動 重啟虛機後,再次檢查firewall的狀態 root localhost hello systemctl disable firewalld.service 開機啟動 重啟虛機後,再次檢查firewall的狀態 臨時和永久關閉selinux 永久關...

Linux關閉防火牆 設定埠

1 重啟後生效 開啟 chkconfig iptables on 關閉 chkconfig iptables off 驗證防火牆是否關閉 chkconfig list grep iptables 2 即時生效,重啟後失效 開啟 service iptables start 關閉 service ip...

Linux 關閉防火牆

centos 6 中防火牆預設是 iptables,而 centos 7 中防火牆預設是 firewall。a 檢視防火牆狀態 service iptable statusb 臨時關閉防火牆 臨時關閉防火牆 servcie iptables stop 臨時啟動防火牆 service iptables...