linux下执行防火墙相关指令报错:Redirecting to /bin/systemctl restart iptables.service

 

安装systemctl:
yum install iptables-services

设置开机启动
systemctl enable iptables.service

如果报错:Failed to start IPv4 firewall with iptables.

因为centos7默认的防火墙是firewalld防火墙,不是使用iptables,因此需要先关闭firewalld服务,或者干脆使用默认的firewalld防火墙。
关闭firewalld:
systemctl stop firewalld  
systemctl mask firewalld

开启443端口
iptables -A INPUT -p tcp --dport 443 -j ACCEPT

保存规则
service iptables save

开启服务
systemctl restart iptables.service
posted @ 2020-12-18 16:05  悬剑丶  阅读(4235)  评论(0编辑  收藏  举报