一.首先你需要通过下面的网址申请一个ipv6地址,方法是通过这个网址创建通道
https://www.tunnelbroker.net/
1. 创建一个账号,创建完成后登录即可
2 在刚刚的登陆后的界面选择create regular tunnel
3. 在你的阿里云ECS控制台先找到你的公网IP
4. 将2中的公网IP复制到ipv4 endpoint输入框中
注:填写 IP 时出现 IP is a potential tunnel endpoint. 说明可以添加 ipv6 隧道。
5 关于隧道节点的选择,大家可以在自己的云服务器上分别 ping 一下提供的 IP,选时延低的,这里我选择Asia, HK
6. 点击Create Tunnel
7. 将配置文件复制下来,因为我是ubuntu,所以选择Debian/ubuntu
至此,通道申请结束
二.修改ubuntu中配置
1.
vim /etc/network/interfaces
将1.7的配置文件中的内容复制到最后(vim的使用可以先去熟悉一下)
这里要注意,配置信息全部复制,但local 后面要改为ESC的内网地址,(如果出现Destination unreachable: Address unreachable,则多半是因为复制的时候,local写的是公网的地址而不是内网地址)
2.
vim /etc/sysctl.conf
将
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
改为
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
3.
将
nameserver 2001:4860:4860::8844
nameserver 2001:470:20::2
分别添加到
vim /etc/resolvconf/resolv.conf.d/base
以及
vim /etc/resolv.conf
的末尾
重启,
ping6 -c 5 2001:4860:4860::8888
ping6 -c 5 ipv6.google.com
都能ping通即配置成功