1.开启防火墙
systemctl start firewalld
2.开放指定端口
firewall-cmd --zone=public --add-port=1935/tcp --permanent
3.开放多个端口也可
firewall-cmd --zone=public --add-port=1935-8081/tcp --permanent
4.关闭指定端口
firewall-cmd --zone=public --remove-port=8080/tcp --permanent
5.批量关闭多个端口也可
firewall-cmd --zone=public --remove-port=8080-8081/tcp --permanent
6.查看所有对外端口
firewall-cmd --list-ports
7.重新载入防火墙
firewall-cmd --reload
8.防火墙状态
firewall-cmd --state
9.关闭防火墙
systemctl stop firewalld
10.重启防火墙
systemctl restart firewalld