songqingbo

编者按:

  对于使用了centos6系列系统N年的运维来说,在使用centos7的时候难免会遇到各种不适应。比如防火墙问题。本文主要记录怎么关闭默认的firewalld防火墙,重新启用iptables。

 

1.关闭firewalld防火墙

systemctl stop firewalld
systemctl mask firewalld

2.安装iptables

yum install iptables-services

3.设置开机启动

systemctl enable iptables.service
systemctl [stop|start|restart] iptables。service
#or
service iptables [stop|start|restart]

注意:

在启动的时候会遇到这样的问题:Unit iptables.service failed to load
问题根源是在/etc/sysconfig/下面没有找到iptables文件。解决办法如下:
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
/usr/libexec/iptables/iptables.init save #保存成功
然后再执行
systemctl start iptables.service

  

  

  

  

分类:

技术点:

相关文章:

  • 2022-02-10
  • 2022-01-11
  • 2021-12-05
  • 2021-12-23
  • 2021-05-29
  • 2021-06-14
  • 2022-01-09
  • 2022-12-23
猜你喜欢
  • 2021-12-29
  • 2021-11-30
  • 2022-02-05
  • 2022-01-12
  • 2022-01-24
  • 2021-12-31
  • 2021-07-28
相关资源
相似解决方案