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 小时前
9-Linux驱动开发-设备树=>设备树插件实现 RGB 灯驱动
linux·驱动开发·stm32·嵌入式硬件
叫致寒吧1 小时前
Nginx基于域名的虚拟主机实操案例
运维·服务器·nginx
施努卡机器视觉3 小时前
SNK施努卡车门自动化安装
运维·自动化
梁正雄3 小时前
linux服务-Nginx+Tomcat+Redis之Session 共享 - 容器compose
linux·nginx·tomcat
咕噜签名-铁蛋3 小时前
云服务器与物理服务器、VPS的区别
运维·服务器
恒创科技HK3 小时前
香港服务器流量有限制和带宽有限制区别在哪?
运维·服务器·网络
fengyehongWorld3 小时前
Linux rsync命令
linux
wanhengidc3 小时前
机架式服务器有什么作用?
运维·服务器·web安全·智能手机·云计算
干啥都是小小白3 小时前
Linux C编程
linux·运维·服务器
赖small强4 小时前
【Linux 网络基础】WebSockets 技术指南
linux·网络·https·websockets·ping/pong