Linux 中firewall的使用方法總結
更新時間:2017年08月06日 14:26:19 作者:追尋北極
這篇文章主要介紹了Linux 中firewall的使用方法總結的相關資料,這里提供了使用的命令幫助大家學習理解,需要的朋友可以參考下
Linux 中firewall的使用方法總結
firewall 簡單使用
1,顯示所有配置
firewall-cmd --list-all-zones
2,重新加載配置
firewall-cmd --reload
3,從public移除 interface
firewall-cmd --zone=public --remove-interface=eno16777736
4,查詢外網端口
firewall-cmd --permanent --query-port=8080/tcp
5,刪除8080端口,禁止外網訪問
firewall-cmd --permanent --remove-port=8080/tcp
6,添加8080端口,供外網訪問
firewall-cmd --permanent --add-port=8080/tcp
7,重啟防火墻
systemctl restart firewalld
8,將發(fā)往80端口的請求轉發(fā)到8080
firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080
9,查看一下防火墻現(xiàn)在開啟了哪些服務和端口
[root@localhost ~]# firewall-cmd --list-all public (default, active) interfaces: eno16777736 sources: services: dhcpv6-client ssh ports: 8080/tcp masquerade: no forward-ports: port=80:proto=tcp:toport=8080:toaddr= icmp-blocks: rich rules:
10,設置默認的zone
irewall-cmd --get-default-zone firewall-cmd --set-default-zone=trusted
以上就是Linux 中firewall的簡單實例,如有疑問請留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
相關文章
CentOS下使用LibreOffice實現(xiàn)文檔格式的轉換方式
項目需求,對上傳的文檔進行一些預處理,如果用戶上傳了doc格式的文檔,需要將其處理為docx或者pdf格式,以便后續(xù)的流程對文檔內容進行提取。接下來通過本文給大家分享CentOS下使用LibreOffice實現(xiàn)文檔格式的轉換,感興趣的朋友一起看看吧2019-07-07