Firewalls命令行配置
2024-10-19 10:51:53
1、指定端口开放
查询、开放、关闭端口
# 查询端口是否开放
firewall-cmd --query-port=8080/tcp
# 开放80端口
firewall-cmd --permanent --add-port=80/tcp
# 移除端口
firewall-cmd --permanent --remove-port=8080/tcp
重启 firewall-cmd --reload
查看配置结果
firewall-cmd --list-all
2、指定端口与ip开放
指定端口与ip开放
firewall-cmd --reload
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.0.0.1-10.0.0.5" port protocol="tcp" port="123" accept"
删除规则
firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="10.0.0.2" port protocol="tcp" port="11300" accept" 重启
firewall-cmd --reload
查看配置结果
firewall-cmd --list-all
3、开启允许某个ip访问
firewall-cmd --permanent --add-source=10.0.0.5 --zone=trusted
最新文章
- poj 3687(拓扑排序)
- Java面试:1
- 使用filter获取http请求的出参以及入参
- LoadRunner 接口测试
- 图片填充UIImageView大小不对
- NP-难题
- 一个轻client,多语言支持,去中心化,自己主动负载,可扩展的实时数据写服务的实现方案讨论
- 搭建git代码服务器
- 套接字输入流——InputStream
- bzoj 2957 楼房重建 (线段树+思路)
- PAT (Basic Level) Practise - 害死人不偿命的(3n+1)猜想
- JS获取本周、本季度、本月、上月的开始日期、结束日期
- [ci]jenkins-slave-ssh docker容器化-自动注入key
- sql里的ROW_NUMBER() OVER是啥意思?
- 《编写高质量代码:Web 前端开发修炼之道》 笔记与读后感
- transclude
- 有关https有的网站可以访问有的访问不了的问题
- 教你如何用Nginx搭建一个安全的、快速的微服务架构
- 使用DAO模式开发宠物管理系统---hellokitty
- IIC总线(集成电路总线)
热门文章
- Jmeter教程 录制脚本
- Flink DataStream API 中的多面手——Process Function详解
- MySQL存储结构及SQL分类
- 关于IDEA无法加载main方法的bug
- You have mail in /var/mail/xxx
- Sentry For React 完整接入详解(2021 Sentry v21.8.x)前方高能预警!三万字,慎入!
- python库--tensorflow--io操作
- io流-缓冲流
- CLR无法从COM 上下文*****转换为COM上下文*****,这种状态已持续60秒。
- Spring Boot中有多个@Async异步任务时,记得做好线程池的隔离!