永久的开放需要的端口
sudo firewall-cmd --zone=public --add-port=3000/tcp --permanent
命令含义:
–zone #作用域
–add-port=80/tcp #添加端口,格式为:端口 / 通讯协议
–permanent #永久生效,没有此参数重启后失效
–remove-port=8000/udp # 删除之前添加的 port
重启防火墙
sudo firewall-cmd --reload
之后检查新的防火墙规则
firewall-cmd --list-all
关闭防火墙
由于只是用于开发环境,所以打算把防火墙关闭掉
//临时关闭防火墙,重启后会重新自动打开 systemctl restart firewalld //检查防火墙状态 firewall-cmd --state firewall-cmd --list-all //Disable firewall systemctl disable firewalld systemctl stop firewalld systemctl status firewalld //Enable firewall systemctl enable firewalld systemctl start firewalld systemctl status firewalld
👿 :exclaim: :redface: :biggrin: :surprised: 😡 😉 😐 😥 ➡