centos 7如何使用firewalld 添加策略

前端之家收集整理的这篇文章主要介绍了centos 7如何使用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

原文链接:https://www.f2er.com/centos/376708.html

猜你在找的CentOS相关文章