用命令行方式關閉CentOS防火牆

在防火牆中開放端口80和端口22的方法以下:tcp

#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT  rest

#/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT  
#/etc/rc.d/init.d/iptables save 
重啓計算機後,防火牆默認已經開放了80和22兩個端口。
 
臨時性的徹底關閉防火牆,能夠不重啓機器:
#/etc/init.d/iptables status                ## 查看防火牆狀態
#/etc/init.d/iptable stop                    ## 本次關閉防火牆
#/etc/init.d/iptable restart                ## 重啓防火牆
永久性關閉防火牆:ip

#chkconfig --level 35 iptables off   ## 注意中間的是兩個英式小短線;it

#shutdown -r now                     ##重啓table

相關文章
相關標籤/搜索