centos7端口转发

Posted on   风行天下-2080  阅读(1710)  评论(0编辑  收藏  举报

 

https://www.cnblogs.com/jinanxiaolaohu/p/11280780.html    这个可以  centos7

 https://www.jb51.net/article/112698.htm

查看端口转发https://segmentfault.com/q/1010000011539192/a-1020000011778540

firewall-cmd --zone=public --list-ports

 

(1)添加转发:

[root@k8s-node01 ~]# firewall-cmd --permanent --add-forward-port=port=888:proto=tcp:toport=2020 (https://segmentfault.com/q/1010000011539192/a-1020000011789072)

https://blog.csdn.net/GerZhouGengCheng/article/details/106147399

将apache服务的端口80,转发到端口9090上。

[root@k8s-node01 ~]# firewall-cmd --permanent --add-forward-port=port=9090:proto=tcp:toport=80
success

  • 当我们想把某个端口隐藏起来的时候,就可以在防火墙上阻止那个端口访问,然后再开一个不规则的端口,之后配置防火墙的端口转发,将流量转发过去。
  • 端口转发还可以做流量分发,一个防火墙拖着好多台运行着不同服务的机器,然后用防火墙将不同端口的流量转发至不同机器。



(2)查看转发:

[root@k8s-node01 ~]# firewall-cmd --list-forward-port
(3)删除转发:(https://www.cnblogs.com/navysummer/p/12597646.html)

firewall-cmd --permanent --zone=public --remove-forward-port=port=8056:proto=tcp:toaddr=xxx.xx.xx.xxx:toport=3356 --删除转发规则

 

 

 添加端口转发

firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=3000

将 本地服务器 3000 端口的内容 通过 80 端口暴露出来 提供服务              

编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?

随笔 - 618, 文章 - 0, 评论 - 6, 阅读 - 37万

Copyright © 2025 风行天下-2080
Powered by .NET 9.0 on Kubernetes

点击右上角即可分享
微信分享提示