Add he.net IPv6 tunnel on OpenVZ VPS | 通过he.net的tunnel为openvz vps添加ipv6支持

make sure tun/tap is enabled on your vps first: | 首先检查tun/tap设备是否已打开

cat /dev/net/tun

It should return "File descriptor in bad state". If not, ask your vps provider to enable it. | 如果没有引号中的提示,需要发ticket让vps客服开启

Get a ipv6 tunnel from he.net as http://lflab.com/index.php/2011/04/08/58 | 先在he.net申请一个ipv6地址,免费,可参考:http://lflab.com/index.php/2011/04/08/58

Get tb-tun from: http://tb-tun.googlecode.com/ , The example below shows how to config a tunnelbroker client with client IPv4 address 1.2.3.4, relay server 5.6.7.8 and client IPv6 address 2001:a:b:c::2/64
see http://code.google.com/p/tb-tun/wiki/HOWTO for help: | 添加tb-tun,下面例子中5.6.7.8为服务器地址,客户端地址1.2.3.4,客户端ipv6地址2001:1:b:c::2/64

get http://tb-tun.googlecode.com/files/tb-tun_r18.tar.gz
tar zxvf tb-tun_r18.tar.gz
gcc tb_userspace.c -l pthread -o tb_userspace
setsid ./tb_userspace tb 5.6.7.8 1.2.3.4 sit > /dev/null
ifconfig tb up
ifconfig tb inet6 add 2001:a:b:c::2/64
ifconfig tb mtu 1480
route -A inet6 add ::/0 dev tb

And now ipv6 should be working on your vps. | 完成配置

It works on my vps, on which modprobe ipv6 doesn't work. | 此方案在我的vps通过(CentOS 5.4),可作为不能使用modprobe ipv6的替代方案

You have to run above scripts(start from setsid) after reboot, better write them to a auto-run script. | 每次重启后需要重新执行setsid以后的命令,最好添加到自动执行。

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>