centos7端口转发

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 端口暴露出来 提供服务              

原文地址:https://www.cnblogs.com/yaok430/p/12672321.html