centos7找不到iptables怎么办
centos7找不到iptables怎么办?
centos7下找不到iptables文件?
最近在centos7下,搭建ftp服务,按照步骤一步一步来,发现 etc/sysconfig/iptables这个文件并不存在,然后去找解决方案,
解决办法:
1. 随便写一条iptables命令配置个防火墙规则。如:iptables -P OUTPUT ACCEPT。
[root@iZ23gx7o02aZ /]# cd /etc/sysconfig/ [root@iZ23gx7o02aZ sysconfig]# iptables -P OUTPUT ACCEPT
2. service iptables save进行保存。
[root@iZ23gx7o02aZ sysconfig]# service iptables save iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ] [root@iZ23gx7o02aZ sysconfig]# ls atd firstboot iptables-config networking readonly-root sshd auditd grub irqbalance network-scripts rhn sysstat authconfig htcacheclean kdump ntpd rngd sysstat.ioconf cbq httpd kernel ntpdate rsyslog system-config-firewall clock i18n keyboard prelink sandbox system-config-firewall.old console init modules quota_nld saslauthd udev cpuspeed ip6tables-config netconsole rAId-check selinux crond iptables network readahead smartmontools [root@iZ23gx7o02aZ sysconfig]#
3. service iptables restart命令重启:
[root@iZ23gx7o02aZ sysconfig]# service iptables restart iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] iptables: Applying firewall rules: [ OK ] [root@iZ23gx7o02aZ sysconfig]#
但是在service iptables save进行保存操作时,提示save指令不存在,于是继续找解决方案,
首先不管防火墙有没有关 都使用systemctl stop firewalld 关闭防火墙
然后使用 yum install iptables-services 安装或更新服务
再使用systemctl enable iptables 启动iptables
最后 systemctl start iptables 打开iptables
大功告成
试试service iptables save
栏 目:其它服务器
本文地址:https://zz.feitang.co/server/35135.html
您可能感兴趣的文章
- 01-07Tomcat部署Bolo动态博客
- 01-07图文详解nginx日志切割的实现
- 01-07如何解决swarm docker 端口不通问题
- 01-07详解nginx location指令
- 01-07如何解决docker http 500错误问题
- 01-07windows server 2008安装配置DNS服务器
- 01-07Linux上搭载Nginx负载均衡配置使用案例详解
- 01-07NGINX 权限控制文件预览和下载的实现原理
- 01-07Nginx防盗链与服务优化配置的全过程
- 01-07使用 Apache 反向代理的设置技巧


阅读排行
推荐教程
- 12-23linux中ftp无法访问怎么办
- 12-11docker存储目录迁移示例教程
- 12-10docker start启动容器后仍然exit状态的解决
- 12-10Linux下如何安装Logstash
- 01-05Shell脚本去重的几种方法实例
- 12-22kvm虚拟机配置NAT端口转发的实现方法
- 12-19Zabbix SAML SSO 登录绕过漏洞的操作流程
- 12-15Docker-Compose搭建Spark集群的实现方法
- 12-14Docker Desktop无法正常启动解决(failed to start...)
- 12-14k8s 与docker空间使用分析与清理方法




