Centos7.x 安装Firewalld防火墙


注意:仅适用于Centos7.x

安装Firewalld

  1. yum install firewalld -y

复制代码

启用Firewalld

  1. systemctl enable firewalld
  2. systemctl start firewalld

复制代码

添加常用端口放行

  1. firewall-cmd –permanent –zone=public –add-port=20/tcp
  2. firewall-cmd –permanent –zone=public –add-port=21/tcp
  3. firewall-cmd –permanent –zone=public –add-port=22/tcp
  4. firewall-cmd –permanent –zone=public –add-port=80/tcp
  5. firewall-cmd –permanent –zone=public –add-port=888/tcp
  6. firewall-cmd –permanent –zone=public –add-port=30000-40000/tcp

复制代码

重载Firewalld配置

  1. firewall-cmd –reload

复制代码


转自   https://www.bt.cn/bbs/forum.php?mod=viewthread&tid=387&extra=page%3D15%26filter%3Dtypeid%26typeid%3D10