linux關閉防火牆或者修改防火牆配置的命令

2021-08-02 16:38:17 字數 538 閱讀 4922

開啟: chkconfig iptables on

關閉: chkconfig iptables off

開啟: service iptables start

關閉: service iptables stop

vi /etc/sysconfig/iptables

-a rh-firewall-1-input -m state –state new -m tcp -p tcp –dport 80 -j accept

-a rh-firewall-1-input -m state –state new -m tcp -p tcp –dport 22 -j accept

注意:如果你不配置防火牆,你會訪問不到你在linux系統上安裝的伺服器,解決方式有兩種,

一是關閉防火牆,但是不安全,

二是,直接改防火牆的配置檔案,

具體內容請看我的另一篇部落格:

Linux 關閉防火牆

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

Linux 關閉防火牆

一.linux下開啟 關閉防火牆命令 1 永久性生效,重啟後不會復原開啟 chkconfig iptables on關閉 chkconfig iptables off 2 即時生效,重啟後復原開啟 service iptables start關閉 service iptables stop 需要說明...

linux關閉防火牆

1 重啟後生效 開啟 chkconfig iptables on 關閉 chkconfig iptables off 2 即時生效,重啟後失效 開啟 service iptables start 關閉 service iptables stop 需要說明的是對於linux下的其它服務都可以用以上命令...