gateway 172.0.0.1 NGINX(Kong) UDP 监听 53 端口
udp-server 172.0.0.2 监听 30053 端口
nginx 配置了透明代理proxy_bind $remote_addr transparent;
配置后 udp-server 可以正常获取到客户端 ip 但是无法返回结果给客户端
想问一下 iptable 怎么配置才能正常返回 网关和服务都是跑在 docker 里的
这篇博客的 tc 命令返回值都是 Illegal "match"
相关问题 https://forum.nginx.org/read.php?11,268467
![]() | 1 2ME OP 在 output 链配置了 DNAT 不生效 Reply from unexpected source: gateway#53, expected udp-server#300553 |
![]() | 2 2ME OP #1 Reply from unexpected source: udp-server#30053, expected gateway#53 |
3 guo4224 2021-07-06 12:09:15 +08:00 策略路由,或者直接把默认路由设置成你的 nginx 机器。其他的 haproxy 也是一样 |
![]() | 5 learningman 2021-07-06 13:55:55 +08:00 iptables MASQUERADE |
![]() | 6 2ME OP @learningman MASQUERADE 只是 ip 伪装 不解决 port 不一致的问题 |
![]() | 8 2ME OP @guo4224 入口是 nginx 监听的 53 端口 server 发起回复是 30053 端口 客户端发现回复的端口和发起请求的端口不一致会拒绝的 参考 2 楼的报错信息 |
![]() | 9 2ME OP http://disq.us/p/292lyfk 不知道 tc pedit 能不能解决这个问题 |