You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过特定WireGuard节点将流量路由到隧道外的HTTPS端点

如何通过特定WireGuard节点将流量路由到隧道外的HTTPS端点

我在PeerA和PeerB之间搭建了WireGuard VPN,现在有一个不在WG隧道范围内的HTTPS端点:192.168.2.10:443。

目前的测试结果如下:

  • PeerB可以正常用netcat连接这个HTTPS端点:
    root@peerB:~# nc -vz 192.168.2.10 443
    Connection to 192.168.2.10 443 port [tcp/*] succeeded!
    root@peerB:~# 
    
  • 但PeerA尝试同样操作时会超时:
    root@peerA:# nc -vz 192.168.2.10 443
    192.168.2.10: inverse host lookup failed: Unknown host
    (UNKNOWN) [192.168.2.10] 443 (?) : Connection timed out
    root@peerA:#
    

我不想把这个HTTPS端点加入WireGuard的配置中,而是希望通过在PeerB上配置路由表和规则,让PeerA能够借助PeerB访问到这个端点。

当前我的节点信息和配置如下:

  • PeerA:真实IP: 172.16.1.5 - WireGuard IP: 10.10.10.5
    [Interface]
    PrivateKey = <private_key for PeerA>
    ListenPort = 51820
    FwMark = 0
    
    [Peer] #VPN Gateway
    PublicKey = <public_key for vpn gateway>
    AllowedIPs = 0.0.0.0/0
    Endpoint = vpn-endpoint.com:51820
    
    [Peer] #PeerB
    PublicKey = <public_key for PeerB>
    

备注:内容来源于stack exchange,提问作者carlitobrigante

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 11:29:31