centos7.4启动项里没有禁用防火墙
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7.4启动项里没有禁用防火墙相关的知识,希望对你有一定的参考价值。
CentOS7(Linux)如何关闭防火墙?Linux如何关闭防火墙
关闭防火墙
零、RHEL 6(CentOS6)
# 临时关闭防火墙
servcie iptables stop
# 永久关闭防火墙
chkconfig iptables off
一、RHEL 7 (CentOS 7)
# 开机不自动启动防火墙
sudo systemctl disable firewalld.service
# 关闭防火墙
sudo systemctl stop firewalld.service
二、 SLES
sudo chkconfig SuSEfirewall2_setup off
sudo chkconfig SuSEfirewall2_init off
sudo rcSuSEfirewall2 stop
三、Unutu
sudo service ufw stop
sudo ufw disable
开启防火墙
零、RHEL 6(CentOS6)
# 临时开启防火墙
servcie iptables start
# 永久开启防火墙
chkconfig iptables on
一、RHEL 7 (CentOS 7)
# 开机自动启动防火墙
sudo systemctl enable firewalld.service
# 关闭防火墙
sudo systemctl start firewalld.service
# 查看防火墙状态
sudo systemctl status firewall.service
# 重新启动防火墙
sudo systemctl restart firewall.service
二、 SLES
sudo chkconfig SuSEfirewall2_setup on
sudo chkconfig SuSEfirewall2_init on
sudo rcSuSEfirewall2 start
三、Unutu
sudo service ufw start
或者
sudo ufw
RHEL7(CentOS7 启动关闭服务命令)
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled 参考技术A 一、关闭防火墙
1、重启后永久性生效:
开启:chkconfig iptables on
关闭:chkconfig iptables off
2、即时生效,重启后失效:
开启:service iptables start
关闭:service iptables stop
在开启了防火墙时,做如下设置,开启相关端口,修改 /etc/sysconfig/iptables 文件
centos 7关闭与启用防火墙
查看防火墙状态: systemctl status firewalld.service
关闭防火墙: systemctl stop firewalld.service
执行开机禁用防火墙自启命令 : systemctl disable firewalld.service
启动防火墙:systemctl start firewalld.service
防火墙随系统开机启动 : systemctl enable firewalld.service
以上是关于centos7.4启动项里没有禁用防火墙的主要内容,如果未能解决你的问题,请参考以下文章