Linux指定端口打开关闭指令以及防火墙开关指令
开启端口
firewall-cmd --permanent --add-port=端口号/协议
ps:firewall-cmd --permanent --add-port=6379/tcp
关闭端口
firewall-cmd --permanent --remove-port=端口号/协议
不论开启还是关闭都需要重新载入才能生效
firewall-cmd --reload
查询端口是否开放
firewall-cmd --query-port=端口号/协议