部分国内 ipv6 访问出现端口能通,但 ssl 握手不回包的奇怪问题

2023-04-22 02:53:24 +08:00
 aries1998
大概的网络环境就是 ubuntu 做主路由,iptables 透明代理分流国内国外 ip ,dnsmasq 下发 ipv6 地址, 后端机器都能正常拿到 ipv6 地址.

具体问题表现: 后端机器 pc 或者手机访问国内大部分有 ipv6 部署的比如 B 站都没问题,国外的也没问题,但是有部分国内的 ipv6 地址访问出现超时,目前只发现了 https 协议这块。 这些问题 ipv6 地址直接在路由上访问是没有任何问题的. http://test-ipv6.com/上检测 ipv6 环境也都 ok 。



举个例子 https://www.zhibo8.cc , 这个是我在 windows 机器上用 curl 抓的结果, 服务器 tls 握手直接不回包
curl -v -6 --header "Host:www.zhibo8.cc" https://[2400:3200:1300::7e]:443
* Trying 2400:3200:1300::7e:443...
* TCP_NODELAY set
* Connected to 2400:3200:1300::7e (2400:3200:1300::7e) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):


但是这个 ip 又是通的,比如 icmp
ping 2400:3200:1300::7e

正在 Ping 2400:3200:1300::7e 具有 32 字节的数据:
来自 2400:3200:1300::7e 的回复: 时间=22ms
来自 2400:3200:1300::7e 的回复: 时间=22ms
来自 2400:3200:1300::7e 的回复: 时间=22ms

以及直接 nc 到 443 端口, 也是通的
nc -6 2400:3200:1300::7e 443
get /
HTTP/1.1 400 Bad Request
Server: nginx/1.8.0
Date: Fri, 21 Apr 2023 18:42:58 GMT
Content-Type: text/html
Content-Length: 172
Connection: close

<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>

windows 上查看路由也没问题, 第一跳是我路由器的 ip ,后面就到运营商去了
tracert -d 2400:3200:1300::7e

通过最多 30 个跃点跟踪到 2400:3200:1300::7e 的路由

1 <1 毫秒 <1 毫秒 <1 毫秒 2409:8a4c:a24:9651:d250:99ff:fe44:f5e2
2 3 ms 3 ms 3 ms 2409:804c:27:1:2702:200:2710:1901
3 4 ms 3 ms 3 ms 2409:804c:27:1:2702:400:2710:1900
4 5 ms 4 ms 4 ms 2409:8080:0:2:503:554::
5 23 ms 23 ms 23 ms 2409:8080:0:1:205:503:1:0
6 19 ms 19 ms 19 ms 2409:8080:0:2:205:271:0:1
7 20 ms 19 ms 19 ms 2409:801e:f0:1::5cb
1263 次点击
所在节点    IPv6
4 条回复
miaomiao888
2023-04-22 12:07:08 +08:00
似乎和 MTU 有关: https://www.v2ex.com/t/928381
aries1998
2023-04-22 15:19:32 +08:00
@miaomiao888 果然是 PMTU 黑洞这个问题, 问了些全网开 ipv6 人都正常, 但问的几个都用的 openwrt ,可是固件处理了这个问题。
naoki66
363 天前
ImmortalWrt 21.02.6 目前没有遇到黑洞问题,
lean 自编译 IPV6 总是调不好。
sdcg1994
337 天前
我家上海电信,直接连光猫和连路由器 ipv6 获得之后,都是微信登录不了,之前以为是 cn2 问题,重新拨号到正常网段还是不行,就把 v6 关了

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

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

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

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

© 2021 V2EX