利用HE.net的Tunnel配置IPv6

  • linux
  • 5月 10, 2017
  • 0 评论

本文是继上一篇《CentOS支持IPv6》的后续文章,本文是通过HE.net提供的IPv6 Tunnel来获取虚拟的IPv6虚拟地址,也是我们应用Appstore过审的又一尝试。
具体步骤如下:

(1)登录 https://tunnelbroker.Net/,注册一个新用户。

按照需求如实填写即可,无需担心是否为国内用户。
(2)注册成功后、登录进去选择 User Functions 中的 Create Regular Tunnel

里面可以选择你个喜欢的地区
(3)输入你的服务器IP地址(需要是公网地址),然后可以看到你的tunnel信息:

(4)点击Example Configurations,选择一个你的操作系统

(5)接下来可以配置你的Linux服务器了

如下命令是HE网站上Example Configurations的结果,我的是iproute模式

[root@sudops.com ~]# modprobe ipv6
[root@sudops.com ~]# ip tunnel add he-ipv6 mode sit remote 74.82.46.6 local 123.57.75.214 ttl 255
[root@sudops.com ~]# ip link set he-ipv6 up
[root@sudops.com ~]# ip addr add 2001:470:xx:xxxx::2/64 dev he-ipv6
[root@sudops.com ~]# ip route add ::/0 dev he-ipv6
[root@sudops.com ~]# ip -f inet6 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 fe80::216:xxxx:xxxx:xxxx/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 fe80::216:xxxx:xxxx:xxxx/64 scope link
       valid_lft forever preferred_lft forever
5: he-ipv6: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1480
    inet6 2001:470:xxxx:xxxx::2/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxx:xxxx/128 scope link
       valid_lft forever preferred_lft forever

[root@sudops.com ~]# ifconfig he-ipv6
he-ipv6   Link encap:IPv6-in-IPv4
          inet6 addr: 2001:470:xx:11xxxx3d::2/64 Scope:Global
          inet6 addr: fe80::xxxx:4xxxxbd6/128 Scope:Link
          UP POINTOPOINT RUNNING NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

配置IPv6 DNS
[root@sudops.com ~]# 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

测试是否可以ping通google的IPv6地址:
[root@sudops.com ~]# ping6 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=387 ms
64 bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=2 ttl=55 time=387 ms
64 bytes from tsa03s01-in-x0e.1e100.net: icmp_seq=3 ttl=55 time=387 ms

怎么样已经可以ping通IPv6地址了。

接下来可以配置 Nginx 和 DNS 的 AAAA 解析,然后让 IPv6 用户的访问可以进来,后续可参考后面的 Nginx 配置 IPv6 和 DNS 解析文章。

u2

Related Posts

python cx-Oracle 驱动安装

安装oracle驱动 cx-Oracle驱动二进制版本下载地…

Read more

Nginx 在if语句中限制IP访问

一些web服务,出于安全考虑是不想让其他人访问到,除了添加登录用户认证外,还可以使用Nginx限制IP访问,只允许指定IP的用户访问站点或者接口。

Read more

You Missed

当AI学会读心术:MindPower框架带来的震撼与思考

  • u2
  • 3月 16, 2026
  • 20 views

AI并没有简化软件工程:它只是让糟糕的工程更容易实现了

  • u2
  • 3月 14, 2026
  • 33 views

当ChatGPT遭遇QuitGPT!

  • u2
  • 3月 13, 2026
  • 44 views

AI安全护栏:保护还是束缚?一场不对称的战争

  • u2
  • 3月 11, 2026
  • 52 views

从”养虾”到AI Agent爆发:2026年技术圈的新范式转移

  • u2
  • 3月 9, 2026
  • 88 views

提示词注入:AI时代最危险的漏洞,正在吞噬你的数据

  • u2
  • 3月 7, 2026
  • 101 views
提示词注入:AI时代最危险的漏洞,正在吞噬你的数据