Linux系列(四) 系统安全机制:防火墙->firewalld

在Linux中的防火墙有 ipables 和firewalld两种,今天主要说一下firewalld的使用

 

前言:

平时我们一些网站开启服务以后本地可以访问,其他电脑不可访问可能就是防火墙没有关或者设置许可。

 

开启防火墙

[root@localhost gogs]# systemctl start firewalld

关闭防火墙

[root@localhost gogs]# systemctl stop firewalld  

重启防火墙

[root@localhost gogs]# systemctl restart firewalld

查看防火墙当前状态

[root@localhost gogs]# systemctl status firewalld

查看防火墙所有列表

firewall-cmd --list-ports

指定ip放行

firewall-cmd --zone=public --add-port=80/tcp --permanent

 

通过以上方式可以放行80端口

你可能感兴趣的:(Liunx,系列)