内核 wireguard table=off 为啥用不了 ipv6?

57 天前
 sduoduo233

Wireguard 配置是 mullvad vpn 提供的,我只手动加了 table=off

[Interface]
PrivateKey = ***
Address = 10.73.177.213/32,fc00:bbbb:bbbb:bb01::a:b1d4/128
Table = off # <-- 这里开了 table=off

[Peer]
PublicKey = ***
AllowedIPs = 0.0.0.0/0,::0/0
Endpoint = ***:51820

curl 用 --interface wg1 手动指定了网卡,用 -6 强制 ipv6 ,秒失败:

root@debian:~# curl -6 --interface wg1 -v myip.wtf/json
*   Trying [2607:5300:203:26a1::acab:f001]:80...
* Immediate connect fail for 2607:5300:203:26a1::acab:f001: Network is unreachable
* Failed to connect to myip.wtf port 80 after 4 ms: Couldn't connect to server
* Closing connection 0
curl: (7) Failed to connect to myip.wtf port 80 after 4 ms: Couldn't connect to server

ipv4 正常:

root@debian:~# curl -4 --interface wg1 -v myip.wtf/json
*   Trying 142.44.215.161:80...
* Connected to myip.wtf (142.44.215.161) port 80 (#0)
> GET /json HTTP/1.1
> Host: myip.wtf
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 200 OK
此处省略...

wireguard 连接状态:

root@debian:~# wg
interface: wg1
  public key: ***
  private key: (hidden)
  listening port: 51274

peer: ***
  endpoint: ***:51820
  allowed ips: 0.0.0.0/0, ::/0
  latest handshake: 1 minute, 9 seconds ago
  transfer: 2.21 KiB received, 1.54 KiB sent

求大佬解答

1243 次点击
所在节点    宽带症候群
5 条回复
flynaj
57 天前
你是一个内网 ipv6,要通你需要 ipv6nat
wuruxu
57 天前
不要手动修改 他们提供的 wireguard 配置
直接这样用就可以了
sduoduo233
57 天前
@flynaj 感觉不是这个问题 我把 table=off 删了就能用 ipv6
@wuruxu 我这个 wg 是在 vps 上用的,不想接管 vps 全部流量
popzuk
57 天前
唉,搞商家返现的 VPN 没有提供 IPv6 的。
wuruxu
57 天前
@sduoduo233 默认不要开启 wireguard 的 route
系统上采用 policy route , 选择一部分流量 进入 wg0

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1146960

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX