正在检测...

正在测试IPv4和IPv6连接状态

IPv4

IPv4

检测中...
-
-
IPv6

IPv6

检测中...
-
-

连接类型

-

连接质量评分

0 /100
正在评估...

延迟对比

IPv4
IPv6

What is IPv6?

IPv6 (Internet Protocol version 6) is the latest version of the Internet Protocol, designed to solve IPv4 address exhaustion.

IPv6 Advantages

  • Massive Address Space:IPv6 provides 340 undecillion addresses (2^128), virtually inexhaustible
  • End-to-End Connectivity:Every device can have a public IP, no NAT translation needed
  • Better Performance:Simplified header design, higher routing efficiency
  • Enhanced Security:Built-in IPsec support for better encryption and authentication

Connection Types

Dual Stack

Supports both IPv4 and IPv6, the ideal configuration for accessing all websites

IPv4 Only

Only supports IPv4, the most common configuration, can access most websites

IPv6 Only

Only supports IPv6, less common, some IPv4-only sites may be inaccessible

No Connection

Network connection error or blocked by firewall

How to Enable IPv6?

  • ISP Support:Contact your ISP to confirm if IPv6 service is available
  • Router Configuration:Enable IPv6 in router admin interface (DHCPv6 or SLAAC)
  • Operating System:Modern OS (Windows 10+, macOS, Linux) support IPv6 by default
  • Firewall:Ensure firewall does not block IPv6 traffic

Command Line Detection

Suitable for script automation, server monitoring, CI/CD integration, etc. We provide three detection endpoints supporting multiple output formats.

Quick Start

IPv4 Detection
curl v4.17nas.com

Returns IPv4 address only

IPv6 Detection
curl v6.17nas.com

Returns IPv6 address only

Dual Stack Detection
curl ip.17nas.com

Returns current network priority IP

Quick Start

点击展开查看使用说明
# For personal testing and learning only, not for commercial use. Please comply with local laws.
# Check your public IPv4 address
curl v4.17nas.com

# Check your public IPv6 address
curl v6.17nas.com

# Test IPv4/IPv6priority (access dual-stack site, if returns IPv6, then IPv6 is preferred)
curl ip.17nas.com

Output Formats

Linux / macOS
curl v4.17nas.com
输出示例: 203.0.113.42 Note: 203.0.113.0/24 is an RFC 5737 reserved documentation address range, not a real IP, for demonstration purposes only
Windows PowerShell
Invoke-RestMethod -Uri https://v4.17nas.com
获取完整信息
curl "v4.17nas.com?format=json"
输出示例:
{
  "ip": "203.0.113.42",
  "country": {
    "zh": "示例国家",
    "en": "Example Country",
    "code": "XX"
  },
  "asn": "AS12345 Example ISP Ltd.",
  "location": {
    "zh": "示例国家 示例省份 示例城市 Example ISP",
    "en": "Example Country Example State Example City Example ISP"
  },
  "region": "Example State",
  "city": "Example City",
  "datacenter": "XXX",
  "timezone": "Asia/Shanghai"
}
Note: All data above are RFC standard example data, not real information
提取特定字段 (使用jq)
curl -s "v4.17nas.com?format=json" | jq -r '.country.zh'
输出: 示例国家
格式化输出
curl "v4.17nas.com?format=text"
╔════════════════════════════════════════════╗
║    17NAS IPv4 连接检测报告 / IPv4 Report    ║
╚════════════════════════════════════════════╝

📍 IP地址 / IP Address
   203.0.113.42

🌍 国家/地区 / Country
   示例国家 / Example Country (XX)

🏢 运营商 / ISP
   AS12345 Example ISP Ltd.

📍 位置 / Location
   中文: 示例国家 示例省份 示例城市 Example ISP
   English: Example Country Example State Example City Example ISP

🌐 数据中心 / Datacenter
   XXX

🕐 时区 / Timezone
   Asia/Shanghai

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Powered by 17NAS.com | Cloudflare Workers
Note: All data above are RFC standard example data, not real information

实用脚本示例

Bash 网络诊断脚本 点击展开查看代码

#!/bin/bash
# 17NAS Network Diagnostic Tool

echo "🔍 Detecting network connection..."

# IPv4 Detection
echo -e "\n📡 IPv4 Detection:"
ipv4=$(curl -s v4.17nas.com)
if [[ $ipv4 == *"No IPv4"* ]]; then
    echo "❌ IPv4 not supported"
else
    echo "✅ IPv4 Address: $ipv4"
    curl -s "v4.17nas.com?format=json" | jq -r '"   Country: \(.country.en) (\(.country.code))"'
fi

# IPv6 Detection
echo -e "\n📡 IPv6 Detection:"
ipv6=$(curl -s v6.17nas.com)
if [[ $ipv6 == *"No IPv6"* ]]; then
    echo "❌ IPv6 not supported"
else
    echo "✅ IPv6 Address: $ipv6"
    curl -s "v6.17nas.com?format=json" | jq -r '"   Country: \(.country.en) (\(.country.code))"'
fi

# Access Priority
echo -e "\n⚡ Access Priority:"
curl -s "ip.17nas.com?format=json" | jq -r '"Protocol: \(.protocol)\nPriority: \(.priority.en)"'

echo -e "\n✅ Diagnostic complete!"

Python 检测脚本 点击展开查看代码

import requests

def check_network():
    """Detect IPv4/IPv6 support status"""

    # IPv4 Detection
    print("📡 IPv4 Detection:")
    try:
        r = requests.get('https://v4.17nas.com?format=json')
        data = r.json()

        if 'error' in data:
            print(f"❌ {data['error']['en']}")
        else:
            print(f"✅ IPv4 Address: {data['ip']}")
            print(f"   Country: {data['country']['en']} ({data['country']['code']})")
            print(f"   Location: {data['location']['en']}")
    except Exception as e:
        print(f"⚠️ Detection failed: {e}")

    # IPv6 Detection
    print("\n📡 IPv6 Detection:")
    try:
        r = requests.get('https://v6.17nas.com?format=json')
        data = r.json()

        if 'error' in data:
            print(f"❌ {data['error']['en']}")
        else:
            print(f"✅ IPv6 Address: {data['ip']}")
            print(f"   Country: {data['country']['en']}")
    except Exception as e:
        print(f"⚠️ Detection failed: {e}")

    # Access Priority
    print("\n⚡ Access Priority:")
    try:
        r = requests.get('https://ip.17nas.com?format=json')
        data = r.json()
        print(f"Protocol: {data['protocol']}")
        print(f"Priority: {data['priority']['en']}")
    except Exception as e:
        print(f"⚠️ Detection failed: {e}")

if __name__ == '__main__':
    check_network()

技术特性

全球加速

CDN边缘节点部署,全球范围快速响应

中英双语

支持中文和英文输出,覆盖24个国家/地区映射

无需认证

完全开放API,无需密钥或Token,开箱即用

CORS支持

完整跨域支持,可直接从浏览器JavaScript调用

ipv6_test.notes

  • 默认格式:不带参数时返回简洁模式(仅IP地址),保持向后兼容
  • URL编码:在脚本中使用时,记得对URL参数加引号 "v4.17nas.com?format=json"
  • 超时设置:建议设置3-5秒超时,避免网络波动时长时间等待
  • 缓存控制:API响应头设置 Cache-Control: no-cache,确保获取实时数据
  • 速率限制:虽无明确限制,但请避免高频请求(建议间隔 ≥1秒)

IPv6性能优化建议

提升IPv6网络连接速度和稳定性的实用技巧

DNS优化 - 使用高速IPv6 DNS服务器可显著降低域名解析延迟

推荐公共DNS:

服务商 首选DNS 备用DNS 特点
阿里云 2400:3200::1 2400:3200:baba::1 全球Anycast,延迟低
腾讯DNSPod 2402:4e00:: 2402:4e00:1:: 国内节点丰富
Google 2001:4860:4860::8888 2001:4860:4860::8844 全球通用,可靠
Cloudflare 2606:4700:4700::1111 2606:4700:4700::1001 注重隐私保护

设置方法:

Windows: 网络适配器属性 → IPv6 → DNS服务器地址

Linux: 编辑 /etc/resolv.conf 或使用 systemd-resolved

💡 国内用户推荐阿里云或腾讯云(本地节点,解析更快);国际用户可选Google或Cloudflare

MTU优化 - 适当调整MTU可避免数据包分片,解决"PMTU黑洞"问题,提升传输效率和稳定性

推荐MTU值:

  • 原生IPv6: 1500字节
    以太网默认值,大多数有线网络最佳配置,无需修改
  • PPPoE拨号: 1492字节
    PPPoE协议增加8字节开销 (1500-8=1492)
  • 6to4/Teredo隧道: 1280字节
    IPv6协议规定的最小MTU,确保任何链路都能传输

设置方法:

Linux:

sudo ip link set dev eth0 mtu 1500

Windows:

netsh interface ipv6 set subinterface "以太网" mtu=1500

⚠️ 如果出现部分IPv6网站无法访问,尝试将MTU降至1280或1480,可绕过中间节点对大数据包的限制

隧道协议选择 - 当运营商未提供原生IPv6时,可使用隧道技术在IPv4网络上承载IPv6流量

协议对比:

协议 性能 稳定性 推荐度 说明
6in4 ⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ✅ 推荐 手动配置,端点固定,路径直接
HE Tunnel Broker ⭐⭐⭐⭐ ⭐⭐⭐⭐ ✅ 首选 免费公共服务,全球节点,配置简便
6to4 ⭐⭐⭐ ⭐⭐⭐ ⚠️ 一般 自动隧道,路径不可控,中继质量参差
Teredo ⭐⭐ ⭐⭐ ❌ 不推荐 UDP封装,延迟高(+20~50ms),仅临时方案

HE Tunnel Broker 配置示例:

Linux (ip命令):

sudo ip tunnel add he-ipv6 mode sit remote SERVER_IPv4 local YOUR_IPv4
sudo ip link set he-ipv6 up
sudo ip addr add YOUR_IPv6/64 dev he-ipv6
sudo ip route add ::/0 dev he-ipv6

Windows (netsh):

netsh interface ipv6 add v6v4tunnel "HE-Tunnel" YOUR_IPv4 SERVER_IPv4
netsh interface ipv6 add address "HE-Tunnel" YOUR_IPv6
netsh interface ipv6 add route ::/0 "HE-Tunnel"

选择建议:

  1. 优先:运营商原生IPv6(性能最佳,无额外开销)
  2. 次选:HE Tunnel Broker(免费,全球节点,需公网IPv4)
  3. 备选:6in4手动隧道(需公网IPv4,配置稍复杂)
  4. 临时:Teredo(无公网IP也能用,但性能差)

💡 推荐访问 tunnelbroker.net 注册免费HE隧道,配置后性能接近原生IPv6

双栈优先级 - 在IPv4/IPv6双栈环境下,系统会自动选择协议。调整优先级可避免延迟高的协议拖累访问速度

如何判断优先级?

分别测试两种协议的延迟,选择延迟更低的优先使用:

# Windows / macOS / Linux 通用
ping -4 baidu.com    # 测试IPv4延迟
ping -6 baidu.com    # 测试IPv6延迟

Windows调整优先级:

优先IPv6(IPv6延迟更低时推荐):

netsh interface ipv6 set prefixpolicy ::1/128 50 0
netsh interface ipv6 set prefixpolicy ::/0 40 1

优先IPv4(IPv6不稳定或延迟高时):

netsh interface ipv6 set prefixpolicy ::/0 40 5

Linux调整优先级:

编辑 /etc/gai.conf,取消以下行注释(优先IPv6):

precedence ::ffff:0:0/96  10   # IPv4映射地址优先级
precedence ::/0          40   # IPv6地址优先级

💡 实用建议:如果IPv6延迟低且稳定,设为优先可充分利用优势;若IPv6不稳定,暂时优先IPv4避免等待超时

常见问题排查指南

快速定位并解决IPv6连接问题

IPv6无法获取地址

排查步骤:

  1. 检查光猫IPv6设置
    • 登录光猫管理界面(通常为 192.168.1.1)
    • 找到网络 → IPv6配置
    • 确保IPv6使能已开启
    • 连接模式选择Native DHCPv6SLAAC
  2. 检查路由器设置
    • WAN口开启获取IPv6地址
    • LAN口开启IPv6 RA服务DHCPv6
    • IPv6前缀长度设置为ISP要求(电信/联通56,移动60)
  3. 联系ISP确认
    • 拨打客服电话(电信10000/联通10010/移动10086)
    • 询问你的宽带是否已开通IPv6
    • 部分地区需要主动申请开通

验证命令:

# Windows
ipconfig /all

# Linux/macOS
ip -6 addr show

正常情况下应该看到以23开头的全局单播地址(GUA)

IPv6连接慢于IPv4

可能原因及解决方案:

  1. 使用隧道协议

    通过Teredo/6to4等隧道访问IPv6会增加延迟

    解决: 联系ISP开通原生IPv6,或使用HE Tunnel Broker

  2. DNS解析慢

    ISP提供的IPv6 DNS服务器响应慢

    解决: 更换为公共DNS(阿里云 2400:3200::1)

  3. MTU配置不当

    MTU过大导致分片,降低传输效率

    解决: 调整MTU为1492(PPPoE)或1280(隧道)

  4. 路由路径次优

    某些网站IPv6路由绕远

    测试: traceroute -6 www.baidu.com

    解决: 临时禁用IPv6或等待ISP优化路由

性能测试:

# 对比IPv4和IPv6延迟
# Windows:
ping -4 www.baidu.com
ping -6 www.baidu.com

# Linux / macOS:
ping www.baidu.com
ping6 www.baidu.com

若能正常返回数据包,说明IPv6网络可用。

部分网站IPv6无法访问

常见情况:

  1. 网站未部署IPv6

    许多国内网站仅支持IPv4

    判断: nslookup -type=AAAA example.com

    如果返回No AAAA records found,说明网站不支持IPv6

  2. 防火墙拦截

    路由器或系统防火墙阻止了IPv6流量

    解决: 检查防火墙规则,允许ICMPv6和必要端口

  3. IPv6配置错误

    网关或DNS设置不正确

    解决: 重置网络配置为自动获取

  4. ISP限制

    部分ISP可能限制特定IPv6流量

    解决: 联系ISP客服咨询

诊断命令:

# 测试IPv6连通性
# Windows:
ping -6 www.baidu.com

# Linux / macOS:
ping6 www.baidu.com

# 查看IPv6路由
traceroute -6 www.baidu.com

# 检查DNS解析
nslookup -type=AAAA example.com

若能正常返回数据包,说明IPv6网络可用。

光猫/路由器IPv6配置详解

光猫常见设置:

ISP 连接模式 IPv6前缀 备注
中国电信 Native DHCPv6 /60 或 /64 部分地区为/56
中国联通 SLAAC + DHCPv6 /60 需开启RA和DHCPv6
中国移动 DHCPv6-PD /60 或 /64 部分地区不支持

路由器关键参数:

  • WAN口配置:
    • 获取IPv6地址: ✅ 开启
    • 请求IPv6前缀: ✅ 开启
    • 前缀长度: 56/60/64(根据ISP)
  • LAN口配置:
    • IPv6分配长度: 64
    • IPv6 RA服务: 服务器模式
    • DHCPv6服务: 服务器模式
    • NDP代理: 禁用

桥接模式设置:

如果光猫设为桥接模式,路由器需要配置拨号:

  1. WAN口协议选择PPPoE
  2. 填写宽带账号密码
  3. 勾选获取IPv6地址
  4. IPv6拨号模式选择DHCPv6

💡 部分老旧路由器不支持IPv6,建议更换OpenWrt或新款路由器