CentOS6 关闭防火墙:
- service iptables stop // 临时关闭
- chkconfig iptables off // 禁止开机启动
注: Centos7 使用同样命令, 会提示
- stop iptables.service
- Failed to stop iptables.service: Unit iptables.service not loaded.
CentOS7 关闭防火墙:
- systemctl stop firewalld // 临时关闭
- systemctl disable firewalld // 禁止开机启动
- Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
- Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
也可以安装 iptables-services, 使用下面的命令
- yum install -y iptables-services // 安装 iptables-services
- service iptables stop // 关闭防火墙
- service iptables status // 检查防火墙状态
来源: http://www.bubuko.com/infodetail-2869345.html