使用tunnelbroker构建自己的IPv6代理池
准备
- 阿里云轻量服务器 【Centos 8.2】
- tunnelbroker 账号
- tunnelbroker 通道
脚本如下
- sudo vim /etc/sysctl.conf 编辑系统设置ipv6相关
1
2net.ipv6.conf.all.disable_ipv6 = 0
3net.ipv6.conf.default.disable_ipv6 = 0
4net.ipv6.conf.lo.disable_ipv6 = 0
5net.ipv6.conf.eth0.disable_ipv6 = 0
6
7
-
sudo sysctl -p 重载系统设置
-
获取Example Config
2001:xxx:x:xxx::2/64 = [Client IPv6 Address]
172.xxx.xxx.xx = [服务器内网IP]
- 服务器上执行
1
2sudo modprobe ipv6
3sudo ip tunnel add he-ipv6 mode sit remote 216.66.22.2 local 172.xxx.xxx.xx ttl 255
4sudo ip link set he-ipv6 up
5sudo ip addr add 2001:xxx:x:xxx::2/64 dev he-ipv6
6sudo ip route add ::/0 dev he-ipv6
7sudo ip -f inet6 addr
8
- 验证
1
2curl ipv6.ip.sb
3
- 收尾
1sudo sysctl -w net.ipv6.ip_nonlocal_bind=1 #开启不限制绑定
2
3# 这个地址在配置里面可以找到 【Routed IPv6 Prefixes】
4sudo ip -6 route add local 2001:xxx:x:xxx::/64 dev lo #添加本地回环接口
5# 测试
6curl --interface 2001:xxx:x:xxx::3 ipv6.ip.sb
- 开启代理
1#amd
2
3wget https://github.com/deanxv/go-proxy-ipv6-pool/releases/download/v1.0.0/go-proxy-ipv6-pool-linux-amd64
4
5#arm
6
7wget https://github.com/deanxv/go-proxy-ipv6-pool/releases/download/v1.0.0/go-proxy-ipv6-pool-linux-arm64
8
9
10chmod +x go-proxy-ipv6-pool-linux-amd64
11
12# cidr = 【Routed IPv6 Prefixes】
13nohup ./go-proxy-ipv6-pool-linux-amd64 --port 51422 --cidr 2001:xxx:x:xxx::/64 > proxy.log 2>&1 &
14
15curl -x http://xx.xx.xx.xx:51422 http://6.ipw.cn/
16
17# 会收到变化的ipv6地址