如何通过特定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
相关产品推荐
相关产品推荐

