外網無法通過8080端口訪問阿里服務器。關閉服務器防火牆命令,添加8080端口永久訪問服務器

根據下面命令,打開 firewalld 防火牆:

啓動: systemctl start firewalld

關閉: systemctl stop firewalld

查看服務器上是否安裝了firewall: systemctl status firewalld 

開機禁用  : systemctl disable firewalld

開機啓用  : systemctl enable firewalld

添加8080端口的訪問權限,這裏添加後永久生效

firewall-cmd --zone=public --add-port=8080/tcp --permanent

重新載入,添加端口後重新載入才能起作用

firewall-cmd --reload

查看8080端口訪問權限

firewall-cmd --zone=public --query-port=8080/tcp

關閉8080訪問權限

firewall-cmd --zone=public --remove-port=8080/tcp --permanent

查看已開發的端口

netstat -anp
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章