linux命令:防火墙的操作
启动防火墙
[root@localhost ~]# systemctl start firewalld
查看防火墙状态
[root@localhost ~]# systemctl status firewalld
暂时关闭防火墙
[root@localhost ~]# systemctl stop firewalld
永久关闭防火墙
[root@localhost ~]# systemctl disable firewalld
查看防火墙开放的端口列表
[root@localhost ~]# firewall-cmd --list-ports
命令方式开放端口(8081端口为例)
[root@localhost ~]# firewall-cmd --zone=public --add-port=8081/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
[root@localhost ~]# firewall-cmd --list-ports