|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +categories: tunnelbroker |
| 4 | +title: tunnelbroker ipv6 pool |
| 5 | +date: 2025-07-28 23:48:46 +0800 |
| 6 | +description: 使用 tunnelbroker 构建自己的IPv6 代理池 |
| 7 | +keywords: tunnelbroker 阿里云 |
| 8 | +--- |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +#### 准备 |
| 13 | + |
| 14 | + |
| 15 | +* 阿里云轻量服务器 【Centos 8.2】 |
| 16 | +* tunnelbroker 账号 |
| 17 | +* tunnelbroker 通道 |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +#### 脚本如下 |
| 22 | + |
| 23 | + |
| 24 | +* sudo vim /etc/sysctl.conf 编辑系统设置ipv6相关 |
| 25 | + |
| 26 | + ```bash |
| 27 | + |
| 28 | + net.ipv6.conf.all.disable_ipv6 = 0 |
| 29 | + net.ipv6.conf.default.disable_ipv6 = 0 |
| 30 | + net.ipv6.conf.lo.disable_ipv6 = 0 |
| 31 | + net.ipv6.conf.eth0.disable_ipv6 = 0 |
| 32 | + |
| 33 | + |
| 34 | + ``` |
| 35 | + |
| 36 | +* sudo sysctl -p 重载系统设置 |
| 37 | + |
| 38 | +* 获取Example Config |
| 39 | + |
| 40 | + > 2001:xxx:x:xxx::2/64 = [Client IPv6 Address] |
| 41 | + > 172.xxx.xxx.xx = [服务器内网IP] |
| 42 | + |
| 43 | +* 服务器上执行 |
| 44 | + |
| 45 | + ```bash |
| 46 | + |
| 47 | + sudo modprobe ipv6 |
| 48 | + sudo ip tunnel add he-ipv6 mode sit remote 216.66.22.2 local 172.xxx.xxx.xx ttl 255 |
| 49 | + sudo ip link set he-ipv6 up |
| 50 | + sudo ip addr add 2001:xxx:x:xxx::2/64 dev he-ipv6 |
| 51 | + sudo ip route add ::/0 dev he-ipv6 |
| 52 | + sudo ip -f inet6 addr |
| 53 | + |
| 54 | + ``` |
| 55 | + |
| 56 | +* 验证 |
| 57 | + |
| 58 | + ```bash |
| 59 | + |
| 60 | + curl ipv6.ip.sb |
| 61 | + |
| 62 | + ``` |
| 63 | + |
| 64 | +* 收尾 |
| 65 | + |
| 66 | +```bash |
| 67 | +sudo sysctl -w net.ipv6.ip_nonlocal_bind=1 #开启不限制绑定 |
| 68 | +
|
| 69 | +# 这个地址在配置里面可以找到 【Routed IPv6 Prefixes】 |
| 70 | +sudo ip -6 route add local 2001:xxx:x:xxx::/64 dev lo #添加本地回环接口 |
| 71 | +# 测试 |
| 72 | +curl --interface 2001:xxx:x:xxx::3 ipv6.ip.sb |
| 73 | +``` |
| 74 | + |
| 75 | + |
| 76 | +* 开启代理 |
| 77 | + |
| 78 | + |
| 79 | +```bash |
| 80 | +#amd |
| 81 | +
|
| 82 | +wget https://github.com/deanxv/go-proxy-ipv6-pool/releases/download/v1.0.0/go-proxy-ipv6-pool-linux-amd64 |
| 83 | +
|
| 84 | +#arm |
| 85 | +
|
| 86 | +wget https://github.com/deanxv/go-proxy-ipv6-pool/releases/download/v1.0.0/go-proxy-ipv6-pool-linux-arm64 |
| 87 | +
|
| 88 | +
|
| 89 | +chmod +x go-proxy-ipv6-pool-linux-amd64 |
| 90 | +
|
| 91 | +# cidr = 【Routed IPv6 Prefixes】 |
| 92 | +nohup ./go-proxy-ipv6-pool-linux-amd64 --port 51422 --cidr 2001:xxx:x:xxx::/64 > proxy.log 2>&1 & |
| 93 | +
|
| 94 | +curl -x http://xx.xx.xx.xx:51422 http://6.ipw.cn/ |
| 95 | +
|
| 96 | +# 会收到变化的ipv6地址 |
| 97 | +``` |
| 98 | + |
0 commit comments