CentOS7(Linux)如何关闭防火墙?

centos防火墙常用命令(CentOS7Linux如何关闭防火墙)(1)

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

,