- yuan12282026-10-0512639
纯IPv6的小鸡,GitHub连不上,Telegram也用不了。不用WARP,464XLAT就行。
原理
DNS64把IPv4域名合成IPv6地址,NAT64网关做翻译,本机跑个clatd,程序无感知:
你的程序 → CLAT(本机) → IPv6网络 → PLAT(公网网关) → IPv4互联网
安装
apt-get update && apt-get install -y clatd
配置
备份DNS,换上DNS64(nat64.net的):
cp /etc/resolv.conf /tmp/resolv.conf.bak
echo "nameserver 2a00:1098:2b::1" > /etc/resolv.conf配置PLAT前缀(跟DNS64配对的):
echo "plat-prefix=2a00:1098:2b:0:0:1::/96" > /etc/clatd.conf
启动
后台启动,MTU设1280(IPv6最小值,避免分片丢包):
setsid clatd >/tmp/clatd.log 2>&1 &
sleep 3
ip link set clat mtu 1280
ip addr show clat测试
IPv4域名,期望200:
curl -w "%{http_code} %{time_total}s\n" -o /dev/null https://github.com
Telegram裸IP,404是正常的(说明TCP通了),超时或000才是没通:
curl -w "%{http_code} %{time_total}s\n" -o /dev/null http://149.154.167.51
确认IPv6没搞坏,期望200:
curl -6 -w "%{http_code}\n" -o /dev/null https://cdn.jsdelivr.net
排错
cat /tmp/clatd.log
cat /etc/resolv.conf
ping -6 -c 3 2a00:1098:2b:0:0:1:808:808开机自启
cat > /etc/systemd/system/clatd.service << 'EOF'
[Unit]
Description=464XLAT CLAT daemon
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/sbin/clatd
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload && systemctl enable --now clatd清理
pkill -f clatd
cp /tmp/resolv.conf.bak /etc/resolv.conf
apt-get remove -y clatd
rm -f /etc/clatd.conf /tmp/clatd.log /tmp/resolv.conf.bak备选
nat64.net挂了换这两个:
Trex 芬兰:
DNS: 2001:67c:2b0::4
PLAT: 2001:67c:2b0:db32:0:1::/96level66 德国:
DNS: 2001:67c:2960::64
PLAT: 2001:67c:2960:6464::/96主楼 - 暂无回复