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'
相关推荐
扛枪的书生2 小时前
Linux 网络管理器用法速查
linux
SkyWalking中文站4 小时前
认识 Horizon UI · 1/17:SkyWalking 新一代可观测性控制台
运维·前端·监控
顺风尿一寸5 小时前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
雪梨酱QAQ7 小时前
Kubeneters HA Cluster部署
运维
江华森11 小时前
Spring Cloud 微服务全栈实战:从 Eureka 到 Docker Compose 一文贯通
运维
江华森11 小时前
Matplotlib 数据绘图基础入门
运维
XIAOHEZIcode11 小时前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
江华森11 小时前
NumPy 数值计算基础入门
运维
唐青枫13 小时前
别再只会用 cron:Linux systemd Timer 定时任务实战详解
linux
AlfredZhao2 天前
生产环境里,为什么不建议把普通端口直接暴露到公网?
linux·https·443·80