1. Linux系统: redhatenterpriselinuxserverrelease 6.5 (Santiago )。
暂时关闭防火墙命令:
服务启用停止
服务IP 6表停止
永久关闭防火墙命令:
chkconfig iptables off
chkconfig ip6tables off
查看防火墙状态命令:
服务可移植状态
[ root @ Hadoop~] # cat/etc/red hat-release
redhatenterpriselinuxserverrelease 6.5 (Santiago )。
[ root @ Hadoop~] # serviceiptablesstop
iptables : settingchainstopolicyaccept : filter [确定]
iptables : flushingfirewallrules : [确定]
iptables :卸载模块: [确定]
[ root @ Hadoop~] #服务IP 6表停止
IP6tables : settingchainstopolicyaccept : filter [确定]
IP6tables : flushingfirewallrules : [确定]
IP6tables :卸载模块: [确定]
[ root @ Hadoop~] # serviceiptablesstatus
iptables :防火墙侦听程序。
[ root @ Hadoop~] #服务IP 6表状态
IP6tables :防火墙侦听程序。
[ root @ Hadoop~] # chkconfigiptablesoff
[ root @ Hadoop~] # chkconfig IP6tables off
2. linux系统: centos Linux7.5. 1804 (核心)版) )。
前面提到的几条命令在我在centos 7上使用时失效了。 据网上报道,从7开始,centos默认使用防火墙d。 这是基于iptables的,有iptables核心,但没有安装iptables服务。 所以停止防火墙d服务就可以了
[根@ Hadoop~] # sudosystemctlstopfirewalld.servicesudosystemctldisablefirewalld.service
移除的symlink/etc/systemd/system/multi-user.target.wants/firewall d.service。
移除的symlink/etc/systemd/system/dbus-org.fedora project.firewall D1.service。
如果要迁移到iptables,则必须安装iptables服务并修改命令
[ root @ Hadoop~] # serviceiptablesstop #命令被禁用
重定向到/zs DSE/systemctlstopiptables.service
failedtostopiptables.service : unit iptables.servicenotloaded。
[ root @ Hadoop~] # yuminstalliptables-services
[ root @ Hadoop~] #/zs DSE/systemctlstopiptables.service
[ root @ Hadoop~] #/zs DSE/systemctlstopip6tables.service
永久关闭防火墙
[ root @ Hadoop~] # chkconfigiptablesoff #命令被禁用
note : forwardingrequestto ' systemctldisableiptables.service '。
[ root @ Hadoop~] # systemctldisableiptables.service
[ root @ Hadoop~] # systemctldisableip6tables.service
检查防火墙是否关闭
[ root @ Hadoop~] # firewall-cmd-- state
不运行
总结: centos 7系统关闭防火墙有两种方法。
方式1 :
关闭防火墙: systemctl stop firewalld.service
永久关闭防火墙: systemctldisablefirewalld.service
方式2 :
首先安装iptables服务: yum安装iptables-services
关闭防火墙:/zs DSE/systemctlstopiptables.service/zs DSE/systemctlstopip6tables.service
永久关闭防火墙: systemctldisableiptables.servicesystemctldisableip6tables.service
检查防火墙是否已关闭。 防火墙- cmd-- state