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端口

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章