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

 

posted @ 2020-08-03 11:58  子非鱼灬亦非我  阅读(180)  评论(0编辑  收藏  举报