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'
相关推荐
少妇的美梦17 小时前
logstash教程
运维
chen94517 小时前
k8s集群部署vector日志采集器
运维
chen94517 小时前
aws ec2部署harbor,使用s3存储
运维
轻松Ai享生活21 小时前
5 节课深入学习Linux Cgroups
linux
christine-rr1 天前
linux常用命令(4)——压缩命令
linux·服务器·redis
三坛海会大神5551 天前
LVS与Keepalived详解(二)LVS负载均衡实现实操
linux·负载均衡·lvs
東雪蓮☆1 天前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
qq_264220891 天前
LVS负载均衡群集和LVS+Keepalived群集
运维·负载均衡·lvs
乌萨奇也要立志学C++1 天前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
雨落Liy1 天前
Nginx 从入门到进阶:反向代理、负载均衡与高性能实战指南
运维·nginx·负载均衡