• 周年纪念勋章活动已圆满结束,如有已购买但仍未申请的用户,可以通过对应勋章的下载链接申请~

运营维护 无v4公网接入IPv6

某猫猫

菜鸡\( ̄︶ ̄*\))

管理成员
版主
注册
2018/02/23
消息
268
金粒
13,920金粒
:吃彩瓜:如题,最近有点无聊,折腾一下,先上成果

BTYQyj.png

[LINE][/LINE]
起因,三大运营商出口接近饱和,国际访问体验极差

于是想起了有个东西叫6in4,然后又想起了这东西没加密,然后双想起了匹配到某些sni信息会被阻断6in4 tunnel(憋住别问
顺带叒想起了zerotier可以打成二层组网,所以才有了这篇教程
[LINE][/LINE]
准备工作,需要一台境外的vps、zerotier账号以及HE IPv6 tunnelbroker(如果vps有/48的IPv6可忽略)
本次演示用的是腾讯云的轻量级服务器(124.156及101.32),本地运营商为中国电信AS4134
关于选择腾讯轻量级的原因是便宜还大碗,质量相对也不错(此处贴出各区情况)

相关评测:https://luotianyi.vc/4706.html
现成的评测那么多直接引用多香啊,懒得自己写了(逃
适合自己的vps才是最好的,同时因为zerotier组网的特殊性需要优秀的NAT type以及对udp不能qos得太惨(希望移动没事

软件地址:https://github.com/HMBSbige/NatTypeTester/releases
GitHub加速:https://github.intel-2333.workers.dev/
[LINE][/LINE]
①在/etc/sysctl.conf中检查是否添加
[CODE title="/etc/sysctl.conf"]net.ipv4.conf.all.forwarding = 1
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.all.proxy_ndp = 1
net.ipv6.conf.all.accept_ra = 2[/CODE]
添加并确认无误后执行
代码:
sysctl -p
[LINE][/LINE]
②登陆https://tunnelbroker.net/ 并点击 Create Regular Tunnel创建隧道
在IPv4 Endpoint (Your side)处填入你VPS的IPv4或域名地址
地址选择离你VPS最近的地方并检测延迟,此处使用HE的HK接入点
[CODE title="PING"]PING 216.218.221.6 (216.218.221.6) 56(84) bytes of data.
64 bytes from 216.218.221.6: icmp_seq=1 ttl=57 time=2.03 ms
64 bytes from 216.218.221.6: icmp_seq=2 ttl=57 time=1.86 ms
64 bytes from 216.218.221.6: icmp_seq=3 ttl=57 time=1.94 ms
64 bytes from 216.218.221.6: icmp_seq=4 ttl=57 time=1.96 ms
64 bytes from 216.218.221.6: icmp_seq=5 ttl=57 time=1.89 ms
64 bytes from 216.218.221.6: icmp_seq=6 ttl=57 time=1.91 ms
64 bytes from 216.218.221.6: icmp_seq=7 ttl=57 time=1.88 ms
64 bytes from 216.218.221.6: icmp_seq=8 ttl=57 time=2.01 ms
64 bytes from 216.218.221.6: icmp_seq=9 ttl=57 time=1.95 ms
[/CODE]
确认无误之后即可创建
创建完成后点击 Routed /48: 的 Assign /48 申请/48地址并记录(后面要用)
然后打开example configurations并选择你的系统
我是腾讯轻量级的centos7,并无DD,我选择Linux-net-tools(sit tunnel),复制后ssh执行即可
唔,我知道肯定有些人想用route,记得local填写v4 nat地址(输入ip a中的eth0即可找到)
接入完成后ping dns.google -6确认是否正常工作
[CODE title="ping dns.google -6"]PING dns.google(dns.google (2001:4860:4860::8888)) 56 data bytes
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=1 ttl=120 time=5.01 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=3 ttl=120 time=4.72 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=4 ttl=120 time=4.87 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=5 ttl=120 time=5.24 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=6 ttl=120 time=5.33 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=7 ttl=120 time=4.70 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=8 ttl=120 time=5.25 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=9 ttl=120 time=4.71 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=10 ttl=120 time=4.92 ms[/CODE]
由于重启会失效,建议添加进/etc/rc.local进行开机自启
debian以及ubuntu则添加进/etc/network/interfaces并/etc/init.d/networking restart
[LINE][/LINE]
③在vps上安装zerotier
代码:
curl -s https://install.zerotier.com/ | sudo bash
安装完成后进入https://my.zerotier.com/创建网络
找到你的Network ID并在VPS上执行
代码:
 zerotier-cli set 此处替换你自己的ID allowGlobal=true

然后打勾RFC4193

由于是 PRIVATE 网络,你需要手动打勾你自己的VPS并记录fd开头的那串ipv6
Advanced 的Managed Routes 处添加两个路由并submit,分别是
BIgyB8.jpg


BIg6HS.md.jpg


然后确认其余设置是否如下图一样

同时在 Add IPv6 Address Pool 填写并提交

[LINE][/LINE]
④客户端入网部分
https://www.zerotier.com/download/ 下载对应的客户端并入网,同时因为是 PRIVATE 网络需要你手动勾选客户端
以手机客户端为例,填入网络ID,勾选route all traffic though zerotier并加入网络即可

因为默认路由的原因,如果本地有ipv6的话记得手动设置zerotier为default或直接关闭v6即可
[LINE][/LINE]
哦对了,想起件事,腾讯双11的123套餐和挺便宜的,刚需的可以去瞄一眼

[LINE][/LINE]
写作不易,求大佬们给点回复叭
如文中有什么地方写的不对,请各位大佬指出鸭
 

附件

  • zerotier_logo_black.png
    zerotier_logo_black.png
    31.4 KB · 查看: 22,595
最后编辑:
不明觉厉
 
你是不是误会了什么叫无公网
 
光猫不是可以直开吗,这好像有些麻烦
 
光猫不是可以直开吗,这好像有些麻烦
:次手手:有些地方没有双栈公网,有公网v4就没有v6
顺带这篇只是提供思路,可以通过分流改善境外访问
 
:吃彩瓜:如题,最近有点无聊,折腾一下,先上成果

BTYQyj.png

[LINE][/LINE]
起因,三大运营商出口接近饱和,国际访问体验极差

于是想起了有个东西叫6in4,然后又想起了这东西没加密,然后双想起了匹配到某些sni信息会被阻断6in4 tunnel(憋住别问
顺带叒想起了zerotier可以打成二层组网,所以才有了这篇教程
[LINE][/LINE]
准备工作,需要一台境外的vps、zerotier账号以及HE IPv6 tunnelbroker(如果vps有/48的IPv6可忽略)
本次演示用的是腾讯云的轻量级服务器(124.156及101.32),本地运营商为中国电信AS4134
关于选择腾讯轻量级的原因是便宜还大碗,质量相对也不错(此处贴出各区情况)

相关评测:https://luotianyi.vc/4706.html
现成的评测那么多直接引用多香啊,懒得自己写了(逃
适合自己的vps才是最好的,同时因为zerotier组网的特殊性需要优秀的NAT type以及对udp不能qos得太惨(希望移动没事

软件地址:https://github.com/HMBSbige/NatTypeTester/releases
GitHub加速:https://github.intel-2333.workers.dev/
[LINE][/LINE]
①在/etc/sysctl.conf中检查是否添加
[CODE title="/etc/sysctl.conf"]net.ipv4.conf.all.forwarding = 1
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.all.proxy_ndp = 1
net.ipv6.conf.all.accept_ra = 2[/CODE]
添加并确认无误后执行
代码:
sysctl -p
[LINE][/LINE]
②登陆https://tunnelbroker.net/ 并点击 Create Regular Tunnel创建隧道
在IPv4 Endpoint (Your side)处填入你VPS的IPv4或域名地址
地址选择离你VPS最近的地方并检测延迟,此处使用HE的HK接入点
[CODE title="PING"]PING 216.218.221.6 (216.218.221.6) 56(84) bytes of data.
64 bytes from 216.218.221.6: icmp_seq=1 ttl=57 time=2.03 ms
64 bytes from 216.218.221.6: icmp_seq=2 ttl=57 time=1.86 ms
64 bytes from 216.218.221.6: icmp_seq=3 ttl=57 time=1.94 ms
64 bytes from 216.218.221.6: icmp_seq=4 ttl=57 time=1.96 ms
64 bytes from 216.218.221.6: icmp_seq=5 ttl=57 time=1.89 ms
64 bytes from 216.218.221.6: icmp_seq=6 ttl=57 time=1.91 ms
64 bytes from 216.218.221.6: icmp_seq=7 ttl=57 time=1.88 ms
64 bytes from 216.218.221.6: icmp_seq=8 ttl=57 time=2.01 ms
64 bytes from 216.218.221.6: icmp_seq=9 ttl=57 time=1.95 ms
[/CODE]
确认无误之后即可创建
创建完成后点击 Routed /48: 的 Assign /48 申请/48地址并记录(后面要用)
然后打开example configurations并选择你的系统
我是腾讯轻量级的centos7,并无DD,我选择Linux-net-tools(sit tunnel),复制后ssh执行即可
唔,我知道肯定有些人想用route,记得local填写v4 nat地址(输入ip a中的eth0即可找到)
接入完成后ping dns.google -6确认是否正常工作
[CODE title="ping dns.google -6"]PING dns.google(dns.google (2001:4860:4860::8888)) 56 data bytes
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=1 ttl=120 time=5.01 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=3 ttl=120 time=4.72 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=4 ttl=120 time=4.87 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=5 ttl=120 time=5.24 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=6 ttl=120 time=5.33 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=7 ttl=120 time=4.70 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=8 ttl=120 time=5.25 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=9 ttl=120 time=4.71 ms
64 bytes from dns.google (2001:4860:4860::8888): icmp_seq=10 ttl=120 time=4.92 ms[/CODE]
由于重启会失效,建议添加进/etc/rc.local进行开机自启
debian以及ubuntu则添加进/etc/network/interfaces并/etc/init.d/networking restart
[LINE][/LINE]
③在vps上安装zerotier
代码:
curl -s https://install.zerotier.com/ | sudo bash
安装完成后进入https://my.zerotier.com/创建网络
找到你的Network ID并在VPS上执行
代码:
 zerotier-cli set 此处替换你自己的ID allowGlobal=true

然后打勾RFC4193

由于是 PRIVATE 网络,你需要手动打勾你自己的VPS并记录fd开头的那串ipv6
Advanced 的Managed Routes 处添加两个路由并submit,分别是
BIgyB8.jpg


BIg6HS.md.jpg


然后确认其余设置是否如下图一样

同时在 Add IPv6 Address Pool 填写并提交

[LINE][/LINE]
④客户端入网部分
https://www.zerotier.com/download/ 下载对应的客户端并入网,同时因为是 PRIVATE 网络需要你手动勾选客户端
以手机客户端为例,填入网络ID,勾选route all traffic though zerotier并加入网络即可

因为默认路由的原因,如果本地有ipv6的话记得手动设置zerotier为default或直接关闭v6即可
[LINE][/LINE]
哦对了,想起件事,腾讯双11的123套餐和挺便宜的,刚需的可以去瞄一眼

[LINE][/LINE]
写作不易,求大佬们给点回复叭
如文中有什么地方写的不对,请各位大佬指出鸭
还要vps也挺麻烦不如直接申请一个公网ip
 
用openfrp也还好,就是要实名,国内节点也挺香的:hua_嘿嘿::UTF?:
 
这种貌似纯v6或者v4v6混合的可以用,但纯v4的貌似不能用(部分地区的运营商还只有v4大内网,没接入v6)
 

在线会员

  • SASOURI
  • 一远征2
  • qqt8023
  • 御坂御坂
  • xliang
  • AkkTNT
  • 红葵
  • fanting
  • Carrido
  • 一二九
  • 茶茶space
  • Super_Ling
  • soft
  • 嚣兮
  • 1905373790
  • hhhhGG
  • 小小的子沐呀
  • Abyssalways
  • qifang
  • 椰奶冻冻UwU
  • PuddingKC
...和 41 更多。
后退
顶部 底部