来源:https://www.cnblogs.com/mawenlong/articles/linux-iptables-firewalld.html
centos7防火墙操作
查看状态
systemctl status firewalld
关闭防火墙
systemctl stop firewalld
开启防火墙
systemctl start firewalld
开启端口
firewall-cmd --zone=public --add-port=端口/tcp --permanent # tcp协议
firewall-cmd --zone=public --add-port=端口/udp --permanent # udp协议
重启防火墙(修改端口后,重启防火墙才会生效)
systemctl restart firewalld
查看开放的端口号
firewall-cmd --zone=public --list-ports
永久开启防火墙
systemctl enable firewalld
永久关闭防火墙
systemctl disable firewalld