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

被折叠的 条评论
为什么被折叠?



