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
求大佬解答