linux 开启端口8080,开启和关闭防火墙

firewall-cmd --list-all #查看所有端口
firewall-cmd --permanent --zone=public --add-port=8080/tcp #开启端口
firewall-cmd --reload #重新加载防火墙
firewall-cmd --zone=public --query-port=8080/tcp

systemctl stop firewalld.service
systemctl start firewalld.service
systemctl restart firewalld.service

你可能感兴趣的:(linux 开启端口8080,开启和关闭防火墙)