虚拟机新装了一个CentOs7,然后做防火墙配置的时候找不到iptables文件,解决方法如下:
因为默认使用的是firewall作为防火墙,把他停掉装个iptable
systemctl stop firewalld
systemctl mask firewalld
yum install -y iptables
yum install iptables-services
然后就有iptables文件,就可以作配置
开启服务
systemctl start iptables.service
systemctl restart iptables.service // 重启防火墙使配置生效
systemctl enable iptables.service // 设置防火墙开机启动
其他命令:
检查是否安装了iptables
service iptables status
安装iptables
yum install -y iptables
升级iptables
yum update iptables
安装iptables-services
yum install iptables-services
systemctl disable iptables #禁止iptables服务
systemctl stop iptables #暂停服务
systemctl enable iptables #解除禁止iptables
systemctl start iptables #开启服务
本文介绍如何在 CentOS 7 上安装并配置 iptables 防火墙,包括停止默认的 firewall 服务、安装 iptables 及其服务、启动及设置 iptables 开机启动等步骤。
562

被折叠的 条评论
为什么被折叠?



