在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