Akira_Z

 

Iptables与Firewalld防火墙

       问题起源于在新申请的机器上搭建环境时,发现关闭iptables防火墙以后,公司内部接口测试工具还是连不上服务器节点。主机间能ping通,但telnet不通。

       一顿搜索之后,找到了另一个关闭防火墙的命令:service firewalld stop。

       执行后再查看firewalld的状态,已经更新为inactive,接口测试工具也成功连上节点。

       那么firewalld和iptables的区别是什么呢?

       其实Iptables服务与Firewalld服务都不是真正的防火墙,它们都只是用来定义防火墙策略功能的防火墙管理工具而已。iptables服务会把配置好的防火墙策略交由内核层面的netfilter网络过滤器来处理,而firewalld服务则是把配置好的防火墙策略交由内核层面的nftables包过滤框架来处理。换句话说,当前在Linux系统中其实同时有多个防火墙管理工具共同存在,它们的作用都是为了方便运维人员管理Linux系统的防火墙策略,而咱们只要配置妥当其中一个就足够了。虽然各个工具之间各有优劣特色,但对于防火墙策略的配置思路上是保持一致的。

下面罗列几种防火墙服务的命令:

1、查看防火墙状态

systemctl status firewalld

service  iptables status

2、暂时关闭防火墙(即时生效)

systemctl stop firewalld

service  iptables stop

3、永久关闭防火墙

systemctl disable firewalld

chkconfig iptables off

4、重启防火墙

systemctl enable firewalld

service iptables restart

posted on 2020-04-02 09:26  Akira_Z  阅读(245)  评论(0编辑  收藏  举报

导航