给VPS添加IPV6

[| 2010/06/05 21:11]
| |
今天在网上看到一个文章,是讲关于给VPS添加IPV6地址的,其原理就是利用一台既具有IPV4,又具有IPV6地址的服务器作为代理服务器,通过虚拟一块网卡并将其流量转发至代理服务器,来实现VPS添加IPV6地址的。


实现原理,首先开启TUN,像ramhost是默认开启的,burst.net可以在控制面板里手动开启。假如没有开启的可以联系客服,这里不再赘述。

下载源码并编译:
wget http://tb-tun.googlecode.com/files/tb-tun_r14.tar.gz
tar zxf tb-tun_r14.tar.gz
gcc tb_userspace.c -l pthread -o tb_userspace

这个源码只有一个源文件,代码很短,粗看一下大概是封装和转发的一些东西。

去tunnelbroker.net注册个号,然后Create Regular Tunnel。在IPv4 Endpoint内填入VPS的IP。

建好后,查看Tunnel,Routed /64就是被分配的IPv6地址段。可以从中随便选个IP。

添加虚拟网卡,设置IP等信息。
setsid ./tb_userspace tb [Server IPv4 address] > /dev/null

ifconfig tb up

ifconfig tb inet6 add [你选的IPv6地址]/64

ifconfig tb mtu 1480

route -A inet6 add ::/0 dev tb

一切完成后,ping6 ipv6.google.com测试一下。


原文网址:http://qiaodahai.com/personal/article/2010/openvz-virtual-machine-configuration-ipv6-with-tunnelbroker-net.htm


不过在tunnelbroker.net里是提供Linux下的设置方法的,不依赖外部程序,没有测试,但是原理相同,应该也是好用的。
by snooda | 分类: 默认分类 | 评论(0) | 引用(0) | 阅读(3054)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]