Centos 防火牆開啟關閉、端口開放


一.Centos 6

1.防火牆開啟關閉

[root@xuyj~] service iptables restart/start/stop

2.端口開放

#以8080端口為例
[root@xuyj~] /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT  #寫入修改
[root@xuyj~] /etc/init.d/iptables save   #保存修改
[root@xuyj~] service iptables restart    #重啟防火牆,修改生效

二.Centos 7

1.防火牆開啟關閉

[root@xuyj~] systemctl restart/start/stop firewalld.service

2.端口開放

#permanent 為永久
[root@xuyj~] firewall-cmd --zone=public --add-port=8388/tcp --permanen


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM