网站首页 > 技术教程 正文
一、CentOs7关闭防火墙的命令
1:查看防火状态
systemctl status firewalld service iptables status
2:暂时关闭防火墙
systemctl stop firewalld service iptables stop
3:永久关闭防火墙
systemctl disable firewalld chkconfig iptables off
4:重启防火墙
systemctl enable firewalld service iptables restart
5:永久关闭后重启
chkconfig iptables on
二、firewalld
Centos7默认安装了firewalld,如果没有安装的话,可以使用 yum install firewalld firewalld-config进行安装。
1.启动防火墙
systemctl start firewalld
2.禁用防火墙
systemctl stop firewalld
3.设置开机启动
systemctl enable firewalld
4.停止并禁用开机启动
sytemctl disable firewalld
5.重启防火墙
firewall-cmd --reload
6.查看状态
systemctl status firewalld或者 firewall-cmd --state
7.查看版本
firewall-cmd --version
8.查看帮助
firewall-cmd --help
9.查看区域信息
firewall-cmd --get-active-zones
10.查看指定接口所属区域信息
firewall-cmd --get-zone-of-interface=eth0
11.拒绝所有包
firewall-cmd --panic-on
12.取消拒绝状态
firewall-cmd --panic-off
13.查看是否拒绝
firewall-cmd --query-panic
14.将接口添加到区域(默认接口都在public)
firewall-cmd --zone=public --add-interface=eth0(永久生效再加上 --permanent 然后reload防火墙)
15.设置默认接口区域
firewall-cmd --set-default-zone=public(立即生效,无需重启)
16.更新防火墙规则
firewall-cmd --reload或firewall-cmd --complete-reload(两者的区别就是第一个无需断开连接,就是firewalld特性之一动态 添加规则,第二个需要断开连接,类似重启服务)
17.查看指定区域所有打开的端口
firewall-cmd --zone=public --list-ports
18.在指定区域打开端口(记得重启防火墙)
firewall-cmd --zone=public --add-port=80/tcp(永久生效再加上 --permanent)
猜你喜欢
- 2025-06-23 Linux 操作系统不需要防病毒软件和防火墙的几个原因
- 2025-06-23 Linux防火墙——iptables原理介绍
- 2025-06-23 防火墙/路由器Linux发行版Devil-Linux
- 2025-06-23 五问 Linux 网络防火墙(四):nftables 的高效框架与数据结构
- 2025-06-23 linux防火墙过滤技术iptables的原理及操作命令详解
- 2025-06-23 Linux,操作系统,防火墙,Netfilter,命令及操作
- 2025-06-23 LINUX IPTABLES 防火墙配置(linux防火墙怎么配置)
- 2025-06-23 Linux安全之网络防火墙(linux防火墙在哪)
- 2025-06-23 linux系统相关防火墙iptables命令操作
- 2025-06-23 linux 防火墙基本命令(linux防火墙主要功能)
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)