centos7下找不到iptables文件
最近在centos7下,搭建ftp服务,按照步骤一步一步来,发现 etc/sysconfig/iptables这个文件并不存在,然后去找解决方案, 原文地址:http://blog.csdn.net/iamzhangyouzhi/article/details/41978537 解决办法: 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指令不存在,于是继续找解决方案, 原文地址:http://blog.163.com/xavier_666/blog/static/25884000720163299503423/ 首先不管防火墙有没有关 都使用systemctl stop firewalld 关闭防火墙 然后使用 yum install iptables-services 安装或更新服务 再使用systemctl enable iptables 启动iptables 最后 systemctl start iptables 打开iptables 大功告成 试试service iptables save
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本