Centos7 使用firewall管理防火墙

一、Centos7使用firewall的管理防火墙

1.firewalld基本使用

  启动:systemctl start firewalld

  关闭:systemctl stop firewalld

  状态:systemctl status firewalld

  开机禁用:systemctl disable firewalld

  开机启用:systemctl enable firewalld

2.配置项目

  例1:开放80端口

  a.开启80端口

  命令:firewall-cmd –zone=public –add-port=80/tcp –permanent    #–permanent永久生效,没有此参数重启后失效

  b.重新加载:

  命令: firewall-cmd –reload  #重新加载后生效

 

  例2:关闭80端口

  a.删除80端口:

  命令:firewall-cmd –zone=public –remove-port=80/tcp –permanet

  b.重新加载:

  命令: firewall-cmd –reload  #重新加载后生效

 

  例3:查看已开放的端口

  a.命令:firewall-cmd –zone=public –list-ports

 

posted on 2018-09-03 17:28 Y593216 阅读() 评论() 编辑 收藏

版权声明:本文为y593216原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/y593216/p/9579666.html