6

如何知道自己的VPS的IPv6属性

 3 years ago
source link: https://www.taterli.com/8004/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

如何知道自己的VPS的IPv6属性

注:这是根据我自己的理解所创作,所以可能不靠谱.

根据我观察,VPS分配的IPv6分别有以下几种:

  • Routed Prefix => 杜甫一般提供,少量VPS也提供,自己BGP也属于这一类.
  • Link Prefix => 大多数VPS提供.
  • Specific Address => 少数VPS提供这个选项.
  • No IPv6 / Local Only => 都什么年代了,还没IPv6.

上面的等级,最好是Routed Prefix,如何测试是不是Routed Prefix,最简单方法两个VPS之间打个洞,看是不是可以建立SIT隧道.

下面举个例子,请自行修改参数,分别在两个服务器之间建立一条隧道,如果建立后在B服务器(无IPv6)能连接IPv6服务,则服务商提供的是Routed Prefix.

#设置隧道
ip tunnel add own-ipv6 mode sit remote [服务器B的IPv4地址] local [服务器A的IPv4地址] ttl 255
ip link set own-ipv6 up
#隧道端地址
ip addr add [IPv6前缀]::1/48 dev own-ipv6
#打开 Linux 内核的 IPv6 转发功能
echo "net.ipv6.conf.all.forwarding = 1" >> /etc/sysctl.conf
 

#设置隧道
ip tunnel add own-ipv6 mode sit remote [服务器A的IPv4地址] local [服务器B的IPv4地址] ttl 255
ip link set own-ipv6 up
#隧道端地址
ip addr add [IPv6前缀]::2/48 dev own-ipv6
ip route add ::/0 dev own-ipv6

如果不能通,再看下面,判断是否是Link Prefix,首先第一点,分配给你的IP必须是一个Prefix,不然没得谈,当然Kimsufi虽然说只给1个IPv6,实际上是给了一个Routed Preifx,一般也没这样的奇葩.

ip addr add [IPv6前缀]::2/128 dev eth0
traceroute -s [刚才添加的地址] ipv6.google.com

如果上面的跟踪能通,那么说明给的是Link Prefix.

由于IPv6地址范围很大,给单一地址的不太可能,但是依然有这样的商家.这种就是能访问IPv6,但是不能添加更多地址,比如JustHost之类的.

最后就是不提供地址的,这个不用多说了.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK