1. 程式人生 > >centos 7如何使用firewalld 添加策略

centos 7如何使用firewalld 添加策略

centos firewalld

1、運行、停止、禁用firewalld

啟動:# systemctl start firewalld

查看狀態:# systemctl status firewalld 或者 firewall-cmd --state

停止:# systemctl disable firewalld

禁用:# systemctl stop firewalld

2、vim /etc/firewalld/zones/public.xml

<?xml version="1.0" encoding="utf-8"?>

<zone>

<short>Public</short>

<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>

<service name="dhcpv6-client"/>

<service name="ssh"/> ****添加服務

<service name="https"/>

<port protocol="tcp" port="8080" /> *****添加端口

</zone>


參考:http://www.jb51.net/article/97964.htm


centos 7如何使用firewalld 添加策略