Linux Centos防火墙相关操作命令

防火墙基础操作

shell 复制代码
#开启防火墙
systemctl start firewalld
shell 复制代码
#关闭防火墙
systemctl stop firewalld

重新加载防火墙规则(改了规则后均需执行)

shell 复制代码
firewall-cmd --reload

防火墙开放某端口

shell 复制代码
firewall-cmd --permanent --add-port=8080/tcp

防火墙禁用某ip访问

shell 复制代码
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.0.9" drop'

防火墙查看当前规则

shell 复制代码
firewall-cmd --list-all

防火墙移除某条规则

shell 复制代码
firewall-cmd --permanent --remove-rich-rule='rule family="ipv4" source address="192.168.0.9" drop'
相关推荐
鸡鸭扣1 小时前
Docker:3、在VSCode上安装并运行python程序或JavaScript程序
运维·vscode·python·docker·容器·js
A ?Charis2 小时前
k8s-对接NFS存储
linux·服务器·kubernetes
人工干智能4 小时前
科普:“Docker Desktop”和“Docker”以及“WSL”
运维·docker·容器
落笔画忧愁e4 小时前
FastGPT及大模型API(Docker)私有化部署指南
运维·docker·容器
前端郭德纲5 小时前
前端自动化部署的极简方案
运维·前端·自动化
DC_BLOG5 小时前
Linux-GlusterFS进阶配置
linux·运维·服务器
我们的五年6 小时前
MAC地址是如何在局域网中工作的?
linux
浮华落定7 小时前
Centos开机自启动
linux·运维·centos
去看日出7 小时前
CentOS 7 企业级Redis 7部署指南
linux·redis·centos
End9289 小时前
如何安装虚拟机cenos7系统
大数据·linux·运维