最新消息:其实接手服务器,最最最重要的还是要看下数据库、文件备份情况!!!非常重要!!!

阿里云centos添加ipv6隧道

basic shang 641浏览 0评论

说明:
上一篇阿里云centos开启ipv6支持已经开启了云服务器的ipv6支持,现在再添加下ipv6隧道,就可能通过ipv6上网了

具体:
1. 注册Tunnel broker
https://www.tunnelbroker.net/
注册很容易,就不讲了,注册需要邮箱验证,,gmail、163能收得到认证邮件,qq还是一样收不到

2. 创建通道“Create Regular Tunnel”
填写云服务器ip以及选择默认的隧道节点,点击Create Tunnel创建。填写ip都,如果出现“IP is a potential tunnel endpoint.”则证明可以添加ipv6隧道,一般隧道节点系统已经默认分配,可以手动选择,大家可以在自己的云服务器上分别ping一下这些ip,选时延低的。
阿里云centos添加ipv6隧道

3. 创建ipv6隧道及路由
到下一页面切换到Example configurations选项卡,如果你的VPS是centOS/Debian这些常见Linux的话,下拉菜单选择Linux-route2,出现了设置的命令,复制到自己的云服务器上运行。
阿里云centos添加ipv6隧道

如果执行命令失败,可以复制以下命令,Server IPv4 Address Client IPv4 Address Server IPv6 Address等按IPv6 Tunnel那页对应的填写

# modprobe ipv6
# ip tunnel add he-ipv6 mode sit remote <Server IPv4 Address> local <Client IPv4 Address> ttl 255
# ip link set he-ipv6 up
# ip addr add <Server IPv6 Address> dev he-ipv6
# ip -6 route add ::/0 dev he-ipv6
# ip -f inet6 addr

 
4. 测试ipv6

# ifconfig he-ipv6    ##可以看到已经获取ipv6地址及建立了he-ipv6隧道
he-ipv6   Link encap:IPv6-in-IPv4  
          inet6 addr: x:x:x:x::x/64 Scope:Global
          inet6 addr: x::x:x/128 Scope:Link
          UP POINTOPOINT RUNNING NOARP  MTU:1480  Metric:1
          RX packets:252535 errors:0 dropped:0 overruns:0 frame:0
          TX packets:167086 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:248945037 (237.4 MiB)  TX bytes:22166230 (21.1 MiB)

 

# ping6 ipv6.google.com  ##ping6域名会提示unknown host,这是因为当前系统不支持ipv6解析,只要添加下ipv6的dns服务器就可以了,
unknown host

# ping6 -c 5 2001:4860:4860::8888    ###直接ping6 ipv6是正常的
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=61 time=3.52 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=61 time=3.62 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=61 time=3.95 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=61 time=3.65 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=5 ttl=61 time=3.70 ms

--- 2001:4860:4860::8888 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4009ms
rtt min/avg/max/mdev = 3.525/3.692/3.954/0.157 ms

 
5.添加ipv6的dns服务器,在最后添加nameserver 2001:4860:4860::8888,nameserver 2001:4860:4860::8844谷歌的ipv6 dns服务器

# vim /etc/resolv.conf
options timeout:1 attempts:1 rotate
nameserver x.x.x.x
nameserver x.x.x.x
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844

 
这时再ping6就正常了

# ping6 -c 5 ipv6.google.com
PING ipv6.google.com(tsa03s01-in-x0e.1e100.net) 56 data bytes
64 bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=1 ttl=55 time=25.5 ms
64 bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=2 ttl=55 time=25.5 ms
64 bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=3 ttl=55 time=33.1 ms
64 bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=4 ttl=55 time=25.5 ms
64 bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=5 ttl=55 time=25.4 ms

--- ipv6.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4031ms
rtt min/avg/max/mdev = 25.473/27.040/33.180/3.073 ms

转载请注明:酷喃|coolnull| » 阿里云centos添加ipv6隧道

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址