2022-07-06 529
centos7找不到iptables怎么办?
centos7下找不到iptables文件?
最近在centos7下,搭建ftp服务,按照步骤一步一步来,发现 etc/sysconfig/iptables这个文件并不存在,然后去找解决方案,
解决办法:
1. 随便写一条iptables命令配置个防火墙规则。如:iptables -P OUTPUT ACCEPT。
[root@77ispcom/]# cd /etc/sysconfig/ [root@77ispcomsysconfig]# iptables -P OUTPUT ACCEPT
2. service iptables save进行保存。
[root@77ispcomsysconfig]# service iptables save iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ] [root@77ispcomsysconfig]# 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@77ispcomsysconfig]#
3. service iptables restart命令重启:
[root@77ispcomsysconfig]# 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@77ispcomsysconfig]#
但是在service iptables save进行保存操作时,提示save指令不存在,于是继续找解决方案,
首先不管防火墙有没有关 都使用systemctl stop firewalld 关闭防火墙
然后使用 yum install iptables-services 安装或更新服务
再使用systemctl enable iptables 启动iptables
最后 systemctl start iptables 打开iptables
大功告成
试试service iptables save
原文链接:https://77isp.com/post/1808.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态