CentOS 7开启关闭防火墙firewalld,SELinux

本文详细介绍了CentOS7中三种主要的防火墙管理工具:firewalld、SELinux和iptables。包括如何查看和控制防火墙状态,以及如何开启、关闭和禁用它们。对于SELinux,还涉及了临时和永久更改其状态的方法。此外,文章还提及了防火墙规则的添加、删除和查看操作。

一、防火墙

1、查看防火墙状态

systemctl status firewalld.service

2、打开防火墙

systemctl start firewalld.service

3、关闭防火墙

systemctl stop firewalld.service

4、禁用防火墙

systemctl disable firewalld.service

5、启用防火墙

systemctl enable firewalld.service

二、SELinux防火墙

1、查看SELinux防火墙状态

getenforce

2、临时关闭SELinux防火墙

setenforce 0

3、永久关闭SELinux防火墙

vim /etc/sysconfig/selinux

把SELINUX=enforcing改为SELINUX=disabled

4、临时开启SELinux防火墙(好像无效)

setenforce 1

5、永久开启SELinux防火墙(重启能生效)

vim /etc/sysconfig/selinux

把SELINUX=disabled改为SELINUX=enforcing

三、iptables

1、查看状态

systemctl status iptables.service

2、关闭

systemctl stop iptables.service

3、禁用

systemctl disable iptables.service

CentOS 7 防火墙配置,添加规则,删除规则,查看规则

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值