一、安装iptables
Centos7系统默认是使用firewall作为防火墙,为了更好兼容老的系统配置,将防火墙设置为iptables(用原来centos6.5的配置即可直接用)。
查看firewall防火墙状态:systemctl status firewalld

关闭防火墙
关闭firewall防火墙: systemctl stop firewalld

  1. 关闭防火墙开机自启动
    关闭开机自启动: systemctl disable firewalld
  2. 安装iptables
    在线安装命令: yum install iptables-services
  3. 启动iptabls
    启动命令: systemctl start iptables
  4. 设置成开机自启动
    启动命令: systemctl enable iptables.service