cloudcone ubuntu 绑定添加 IPv6 方法

在 cloudcone 中买了一个 ubuntu VPS,发现支持送不少的 IPv6 地址。正好最近需要用到,就打算直接来使用。

结果发现 ping6 不通。尴尬…

找了一些资料,说的比较复杂,基本上都是说通过安装代理工具,让不支持 IPv6 的机器通过第三方代理的方式获取 IP。

但我的这个是本身有,自己却用不了啊。

查了半天,其实解决很简单,只需要在系统中绑定 IPv6 的地址就好了,就这么简单。

编辑 /etc/network/interfaces 文件:

默认应该是下面这样子,只有 IPv4 的地址:

1
2
3
4
5
6
7
8
9
10
11
# Generated by SolusVM

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 173.82.xx.xx
gateway 173.82.xx.xx
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4

只需要在后面增加上 IPv6 的信息就好了:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Generated by SolusVM

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 173.82.243.11
gateway 173.82.243.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4

+ iface eth0 inet6 static
+ address 2607:f130::xx:xx
+ netmask 64
+ gateway 2607:f130::xx:xx

之后,可以查看下网络信息

1
ifconfig

应该可以看到刚刚配置好的 IPv6 信息。

之后,通过 ping6 再测试下:

1
ping6 ipv6.google.com

可以看到正常回复了:

1
2
3
4
5
6
7
64 bytes from lax31s01-in-x0e.1e100.net: icmp_seq=6 ttl=58 time=0.717 ms
64 bytes from lax31s01-in-x0e.1e100.net: icmp_seq=7 ttl=58 time=0.704 ms
64 bytes from lax31s01-in-x0e.1e100.net: icmp_seq=8 ttl=58 time=1.52 ms
64 bytes from lax31s01-in-x0e.1e100.net: icmp_seq=9 ttl=58 time=0.783 ms
64 bytes from lax31s01-in-x0e.1e100.net: icmp_seq=10 ttl=58 time=0.633 ms
64 bytes from lax31s01-in-x0e.1e100.net: icmp_seq=11 ttl=58 time=0.638 ms
64 bytes from lax31s01-in-x0e.1e100.net: icmp_seq=12 ttl=58 time=0.784 ms

–END–