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

最新文章

  1. poj 3687(拓扑排序)
  2. Java面试:1
  3. 使用filter获取http请求的出参以及入参
  4. LoadRunner 接口测试
  5. 图片填充UIImageView大小不对
  6. NP-难题
  7. 一个轻client,多语言支持,去中心化,自己主动负载,可扩展的实时数据写服务的实现方案讨论
  8. 搭建git代码服务器
  9. 套接字输入流——InputStream
  10. bzoj 2957 楼房重建 (线段树+思路)
  11. PAT (Basic Level) Practise - 害死人不偿命的(3n+1)猜想
  12. JS获取本周、本季度、本月、上月的开始日期、结束日期
  13. [ci]jenkins-slave-ssh docker容器化-自动注入key
  14. sql里的ROW_NUMBER() OVER是啥意思?
  15. 《编写高质量代码:Web 前端开发修炼之道》 笔记与读后感
  16. transclude
  17. 有关https有的网站可以访问有的访问不了的问题
  18. 教你如何用Nginx搭建一个安全的、快速的微服务架构
  19. 使用DAO模式开发宠物管理系统---hellokitty
  20. IIC总线(集成电路总线)

热门文章

  1. Jmeter教程 录制脚本
  2. Flink DataStream API 中的多面手——Process Function详解
  3. MySQL存储结构及SQL分类
  4. 关于IDEA无法加载main方法的bug
  5. You have mail in /var/mail/xxx
  6. Sentry For React 完整接入详解(2021 Sentry v21.8.x)前方高能预警!三万字,慎入!
  7. python库--tensorflow--io操作
  8. io流-缓冲流
  9. CLR无法从COM 上下文*****转换为COM上下文*****,这种状态已持续60秒。
  10. Spring Boot中有多个@Async异步任务时,记得做好线程池的隔离!