大网数据广告活动
服务器运维问答

Forward incoming UDP Packets on Windows Server to client on different interface

· 52CE 我爱测

I have the following setup with 2 networks and 3 clients: Network A: 192.168.0.0/16 Network B: 172.16.0.0/12 Client 1 is connected to Network A (192.168.0.1) Client 2 (Windows Server) is connected to Network A (192.168.0.2) and N…

问题原文

原帖链接 · ShadowEagle · CC BY-SA 4.0

I have the following setup with 2 networks and 3 clients:

  • Network A: 192.168.0.0/16

  • Network B: 172.16.0.0/12

  • Client 1 is connected to Network A (192.168.0.1)

  • Client 2 (Windows Server) is connected to Network A (192.168.0.2) and Network B (172.16.0.2)

  • Client 3 is connected to Network B (172.16.0.1)

In my setup Client 2 acts as a bridge between the two networks. I can't modify the existing network structure, install any software on Client 1 or 3 or modify the system in any way.

Client 1 is sending UDP Packets to Client 2 (192.168.0.2) to Port 1202. Now I want to forward the Packets to Client 3 (172.16.0.1) to Port 1202. If possible, this should also work in the opposite direction.

The following command using netsh should have made this work.

netsh interface portproxy add v4tov4 listenaddress=192.168.0.2 listenport=1202 connectaddress=172.16.0.1 connectport=1202

However, this only works for TCP traffic and not for UDP.

I also found a program called Simple UDP proxy/pipe found on this website, however I could not get it to forward any traffic.

已采纳解答

原帖链接 · Martin · CC BY-SA 4.0

I would recommend using socat... this program also exists for windows link. It takes a little time to read into that tool, but it is really powerful.

Here is an explanation how to forward udp traffic with socat.

There exists another way: you could turn your windows server into a network router. This article explains how. You would need the correct routes installed at client 1 & 3 - so this option is more complicated.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-01-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。