纯ipv6 VPS使用方法

纯 IPV6 VPS使用技巧总结

本地Windows 电脑不支持IPV6

测试环境的ipv6支持情况

1
2
ping -6 ipv6.test-ipv6.com
ping -6 [2001:470:1:18::125]

开启teredo隧道

  1. 执行命令Win + x

  2. 打开终端管理员(PowerShell终端服务器)

  3. teredo命令

    • 检查当前Teredo状态

      1
      netsh interface teredo show state
    • 开启Teredo隧道(default就是win10.ipv6.microsoft.com)

      1
      2
      netsh interface ipv6 reset
      netsh interface teredo set state enterpriseclient server=default
    • Teredo隧道服务器

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      win10.ipv6.microsoft.com
      win1901.ipv6.microsoft.com
      win1807.ipv6.microsoft.com
      win1710.ipv6.microsoft.com
      teredo.remlab.net / teredo-debian.remlab.net (法国) (Miredo 默认设置)
      teredo.autotrans.consulintel.com (西班牙)
      teredo.ipv6.microsoft.com (美国 雷蒙德) (Windows XP/2003/Vista/7/2008 系统默认设置)
      teredo.ngix.ne.kr (韩国)
      teredo.managemydedi.com (美国 芝加哥)
      teredo.trex.fi
      teredo.iks-jena.de
    • 关闭Teredo隧道

      1
      netsh interface Teredo set state disable
    • 配置Teredo端口(如果IPV6隧道开启不成功, 可以更换端口在检查隧道状态)

      1
      2
      netsh interface Teredo set state natawareclient clientport=60409
      netsh interface Teredo set state enterpriseclient clientport=60309

纯IPV6 VPS添加IPV4出口

  • 方法一: 安装warp

    执行一下命令添加warp出口:

    1
    2
    3
    wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh
    bash menu.sh 4 //添加ipv4出口
    bash menu.sh 6 //添加ipv6出口

    或者:

    1
    2
    3
    wget https://raw.githubusercontent.com/yirenchengfeng1/warp/main/warp.sh
    bash warp.sh 4 //添加warp的ipv4出口
    bash warp.sh 6 //添加warp的ipv6出口

纯IPV6 如何获取地址

  • 获取ipv4的地址

    1
    curl -s4m5 icanhazip.com -k
  • 获取ipv6的地址

    1
    curl -s6m5 icanhazip.com -k
  • 判断ipv4地址是否为warp ip, 为on表示warp ip

    1
    curl -s4m5 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2
  • 判断ipv6地址是否为warp ip, 为off表示不是warp ip

    1
    curl -s6m5 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2
  • 检测ipv4地址和位置信息

    1
    curl -4 ip.p3terx.com
  • 检测ipv6地址和位置信息

    1
    curl -6 ip.p3terx.com

更换网络优先级

ipv4优先

编辑/etc/gai.conf文件,在末尾添加下面这行配置:

1
precedence ::ffff:0:0/96  100

ipv6优先

编辑/etc/gai.conf文件,在末尾添加下面这行配置:

1
label 2002::/16   2

验证优先级

执行 curl ip.p3terx.com 命令,显示 IPv4 地址则代表 IPv4 优先,否则为 IPv6 优先。