#查看防火墙状态:systemctl status firewalld
开启防火墙:systemctl startfirewalld
关闭防火墙:systemctl stop firewalld
#查看端口是否对外开放:firewall-cmd --query-port=6379/tcp
#开放端口:
1.添加指定需要开放的端口:
firewall-cmd --add-port=6379/tcp --permanent
2.重载入添加的端口:
firewall-cmd --reload
3.查询指定端口是否开启成功:
firewall-cmd --query-port=6379/tcp
转载:https://blog.csdn.net/realjh/article/details/82048492