CentOS 7.x firewall防火墙设置

放行端口

firewall-cmd --add-port=2049/tcp --permanent
firewall-cmd --add-port=2049/udp --permanent

重启防火墙

firewall-cmd --reload

检查防火墙状态

firewall-cmd --state

关闭防火墙

systemctl stop firewalld.service

关闭防火墙自启

systemctl disable firewalld.service

查看已经开启的端口

firewall-cmd --list-ports