Add he IPv6 Tunnel to VPS of OpenVZ architecture through TB Tun

September 28, 2018 434 point heat 0 liked it 0 comments

Register for he IPv6 Tunnel

https://tunnelbroker.net

Create regular tunnel

After logging in, click create regular tunnel
Select the nearest node

Compile and install TB Tun

Download TB tun the way you like

Github:  https://github.com/acgrid/tb-tun

 wget https://github.com/acgrid/tb-tun/archive/master.zip

Enter the TB Tun file directory

After downloading and decompressing, move the file to the folder and execute the following command

Start compiling

 gcc tb_ userspace.c -l pthread -o tb_ userspace

If you do not have GCC dependencies installed, install GCC first.

 yum install gcc

Create tunnel

The device needs to turn on Tun / tap

Please use cat /dev/net/tun View
Under normal circumstances, it should prompt:
File descriptor in bad state

Set up tunel

 setsid ./tb_ userspace he-ipv6 [server ipv4 addr] [client ipv4 addr] sit > /dev/null  
ifconfig he-ipv6 inet6 add [client ipv6 addr]
ifconfig he-ipv6 mtu 1480
ifconfig he-ipv6 up
route -A inet6 add ::/0 dev he-ipv6
ip -6 route del default dev venet0

Please modify the address of [server IPv4 addr], [Client IPv4 addr], [Client IPv6 addr]

Test connection

 ping6 ipv6.google.com

Create boot task

It will be invalid after startup. You need to continue input from setting TUNEL. Please solve it by yourself.

Gcod

Talking about the trivial matters of life and talking about the whole world, that's all

Article review