haproxy 作为 ipv4 到 ipv6

haproxy 作为 ipv4 到 ipv6

我在互联网上有一个小型 Linux 服务器,我在其上运行 socat。

socat UDP4-LISTEN:1194,fork UDP6-SENDTO:[****:****:****:****:*** *:****:****:****]:1194 

我将其作为服务安装。到目前为止,它运行良好,没有任何问题。顺便说一句,我需要所有这些,因为我只有一个可以从互联网访问的 ipv6。还有一个使用 tcp 端口 80 的服务。现在我想用 haproxy 来做。我的想法是,我可以根据 URL 或端口重定向到其他地址。SSL 也很好,但首先要做的是。起初我想重定向 udp 端口​​ 1194。所以我将以下内容添加到 cfg:

listen vpn
        bind udp@:1194
        use-server wg_server if { hdr(host) -i abc.com }
        server wg_server ipv6@[####:####:####:####:####:####:####:####]:1194 check port 1194

但是通过 cfg 检查(haproxy -c -f),我收到以下消息:“bind”:dgram 类型套接字在“udp@:1194”中不可接受

因此,如果没有 UDP:

listen vpn
        binding :1194
        use-server wg_server if { hdr(host) -i abc.com }
        server wg_server ipv6@[####:####:####:####:####:####:####:####]:1194

cfg 检查现在没问题,但是当我启动 haproxy 时我收到消息:代理 vpn 没有可用的服务器!

通过 nmap 查询报告称,该地址可以访问端口。因此,cfg 中存在问题。有人能提供提示吗?

亲切问候 Orko

答案1

好的。我可能应该先检查一下。

haproxy 不支持 UDP。因此,我将使用 socat,并仅根据端口号进行重定向。

相关内容