Linux防火牆配置

2022-05-04 13:24:07 字數 479 閱讀 6439

1) 永久性生效,重啟後不會復原 

開啟: chkconfig iptables on 

關閉: chkconfig iptables off 

2) 即時生效,重啟後復原 

開啟: service iptables start 

關閉: service iptables stop 

需要說明的是對於linux下的其它服務都可以用以上命令執行開啟和關閉操作。 

在開啟了防火牆時,做如下設定,開啟相關埠, 

修改/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防火牆配置

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

linux 防火牆配置

把tcp的80埠配置為允許任何ip訪問 iptables i input ptcp dport 80 j accept 上面第三步的方法只是臨時生效的,只要你重啟了虛擬機器或者說重啟了linux,就必須重新設定才可以訪問,解決辦法如下 在命令列下輸入 vi etc selinux config 修改...

linux 防火牆配置

防火牆配置 centos 7預設使用的是firewall作為防火牆,這裡改為iptables防火牆。firewall操作 service firewalld status 檢視防火牆狀態 disabled 表明 已經禁止開啟啟動 enable 表示開機自啟,inactive 表示防火牆關閉狀態 ac...