forked from YG-tsj/CFWarp-Pro
-
Notifications
You must be signed in to change notification settings - Fork 5
/
multiOV6.sh
550 lines (436 loc) · 16.8 KB
/
multiOV6.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
#!/bin/bash
bit=`uname -m`
if [[ ${bit} == "x86_64" ]]; then
#彩色
red(){
echo -e "\033[31m\033[01m$1\033[0m"
}
green(){
echo -e "\033[32m\033[01m$1\033[0m"
}
yellow(){
echo -e "\033[33m\033[01m$1\033[0m"
}
blue(){
echo -e "\033[36m\033[01m$1\033[0m"
}
function BBR(){
wget --no-check-certificate https://raw.githubusercontent.com/cx9208/Linux-NetSpeed/master/tcp.sh && chmod +x tcp.sh && ./tcp.sh
}
function cwarp(){
systemctl stop wg-quick@wgcf
systemctl disable wg-quick@wgcf
reboot
}
function owarp(){
systemctl enable wg-quick@wgcf
systemctl start wg-quick@wgcf
}
function ssgo(){
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/ss-go.sh && chmod +x ss-go.sh && bash ss-go.sh
}
function ss(){
wget -N --no-check-certificate -c -t3 -T60 -O ss-plugins.sh https://git.io/fjlbl
chmod +x ss-plugins.sh
./ss-plugins.sh
}
function ipv4(){
curl -4 ip.p3terx.com
}
function ipv6(){
curl -6 ip.p3terx.com
}
function Netflix(){
wget -O nf https://cdn.jsdelivr.net/gh/sjlleo/netflix-verify/CDNRelease/nf_2.60_linux_amd64 && chmod +x nf && clear && ./nf -method full
}
function reboot(){
sudo reboot
}
function dns(){
echo 'DNS=2a00:1098:2c::1'>> /etc/systemd/resolved.conf
systemctl restart systemd-resolved
systemctl enable systemd-resolved
mv /etc/resolv.conf /etc/resolv.conf.bak
ln -s /run/systemd/resolve/resolv.conf /etc/
sudo reboot
}
function linux5.11(){
cd /tmp
wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-headers-5.11.0-051100_5.11.0-051100.202102142330_all.deb
wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-headers-5.11.0-051100-generic_5.11.0-051100.202102142330_amd64.deb
wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-image-unsigned-5.11.0-051100-generic_5.11.0-051100.202102142330_amd64.deb
wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-modules-5.11.0-051100-generic_5.11.0-051100.202102142330_amd64.deb
sudo dpkg -i *.deb
reboot
}
function v646(){
yellow " 检测当前内核版本 "
uname -r
main=`uname -r | awk -F . '{print $1 }'`
minor=`uname -r | awk -F . '{print $2}'`
if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then
red " 检测到内核版本小于5.6,为实现WARP网络效能最高的内核集成Wireguard方案,回到菜单,选择1,更新内核吧"
exit 1
fi
apt update
apt -y --no-install-recommends install openresolv dnsutils wireguard-tools
wget -N -6 https://cdn.jsdelivr.net/gh/YG-tsj/EUserv-warp/wgcf
cp wgcf /usr/local/bin/wgcf
chmod +x /usr/local/bin/wgcf
echo | wgcf register
wgcf generate
sed -i "5 s/^/PostUp = ip -6 rule add from $(wget -qO- ipv6.ip.sb) table main\n/" wgcf-profile.conf
sed -i "6 s/^/PostDown = ip -6 rule delete from $(wget -qO- ipv6.ip.sb) table main\n/" wgcf-profile.conf
sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf
sed -i 's/1.1.1.1/2001:4860:4860::8888,2001:4860:4860::8844,8.8.8.8,8.8.4.4/g' wgcf-profile.conf
cp wgcf-account.toml /etc/wireguard/wgcf-account.toml
cp wgcf-profile.conf /etc/wireguard/wgcf.conf
systemctl enable wg-quick@wgcf
systemctl start wg-quick@wgcf
rm -f wgcf*
grep -qE '^[ ]*precedence[ ]*::ffff:0:0/96[ ]*100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf
yellow " 检测是否成功启动(IPV4+IPV6)双栈Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) 显示IPV6地址:$(wget -qO- ipv6.ip.sb) "
green " 如上方显示IPV4地址:8.…………,IPV6地址:2a09:…………,则说明成功啦!\n 如上方IPV4无IP显示,IPV6显示本地IP(说明申请WGCF账户失败),请继续运行该脚本吧,直到成功为止!!! "
}
function v64(){
yellow " 检测当前内核版本 "
uname -r
main=`uname -r | awk -F . '{print $1 }'`
minor=`uname -r | awk -F . '{print $2}'`
if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then
red " 检测到内核版本小于5.6,为实现WARP网络效能最高的内核集成Wireguard方案,回到菜单,选择1,更新内核吧"
exit 1
fi
apt update
apt -y --no-install-recommends install openresolv dnsutils wireguard-tools
wget -N -6 https://cdn.jsdelivr.net/gh/YG-tsj/EUserv-warp/wgcf
cp wgcf /usr/local/bin/wgcf
chmod +x /usr/local/bin/wgcf
echo | wgcf register
wgcf generate
sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf
sed -i '/\:\:\/0/d' wgcf-profile.conf
sed -i 's/1.1.1.1/2001:4860:4860::8888,2001:4860:4860::8844,8.8.8.8,8.8.4.4/g' wgcf-profile.conf
cp wgcf-account.toml /etc/wireguard/wgcf-account.toml
cp wgcf-profile.conf /etc/wireguard/wgcf.conf
systemctl enable wg-quick@wgcf
systemctl start wg-quick@wgcf
rm -f wgcf*
grep -qE '^[ ]*precedence[ ]*::ffff:0:0/96[ ]*100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf
yellow " 检测是否成功启动Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) "
green " 如上方显示IPV4地址:8.…………,则说明成功啦!\n 如上方显示VPS本地IP,(说明申请WGCF账户失败),请继续运行该脚本吧,直到成功为止!!! "
}
function status(){
systemctl status wg-quick@wgcf
}
function 6x86(){
wget -6 -N --no-check-certificate https://raw.githubusercontent.com/xOS/Warp/main/multiOV6.sh && chmod +x multiOV6.sh && ./multiOV6.sh
}
function 4x86(){
wget -4 -N --no-check-certificate https://raw.githubusercontent.com/xOS/Warp/main/multiOV6.sh && chmod +x multiOV6.sh && ./multiOV6.sh
}
#主菜单
function start_menu(){
clear
red " 围绕WARP功能的脚本,目前仅支持KVM X86架构的纯IPV6 /Ubuntu 20.04系统,还在优化添加新功能中…… "
red " =================================================================================================="
yellow " 切记:进入脚本快捷方式 bash ~/multiOV6.sh "
blue " =================================================================================================="
blue " 一、VPS状态调整选择及说明(更新中)"
blue " 1. 更新linux系统X86架构通用版内核至5.11版。自动断连后,请重新连接SSH "
blue " 2. DNS64设置。自动断连后,请重新连接SSH(建议选择) "
blue " 3. 开启原生BBR加速(启用WARP后可执行) "
blue " 4. 检测奈飞Netflix是否解锁(启用WARP后可执行) "
green " =================================================================================================="
green " 二、WARP功能选择(更新中)"
green " ----VPS原生IP数--------------添加WARP虚拟IP的位置-----------是否需要输入相关IP--------------------"
green " 5. 纯IPV6的VPS。 添加WARP虚拟IPV4+虚拟IPV6 (无须输入IP地址!)"
green " 6. 纯IPV6的VPS。 添加WARP虚拟IPV4 (无须输入IP地址!)"
green " --------------------------------------------------------------------------------------------------"
green " 7. 永久关闭WARP功能。自动断连后,请重新连接SSH "
green " 8. 自动开启WARP功能 "
green " 9. 在WARP开启状态下更新脚本 "
green " 10. 在WARP关闭状态下更新脚本 "
green " 11. 查看当前WARP运行状态 "
green " 12. 查看VPS当前正在使用的IPV4地址 "
green " 13. 查看VPS当前正在使用的IPV6地址 "
yellow " =================================================================================================="
yellow " 三、代理协议脚本选择(更新中)"
yellow " 14. 安装 Shadowsocks-Go "
yellow " =================================================================================================="
red " 15. 重启VPS实例,请重新连接SSH "
red " =================================================================================================="
red " 0. 退出脚本 "
echo
read -p "请输入数字:" menuNumberInput
case "$menuNumberInput" in
1 )
linux5.11
;;
2 )
dns
;;
3 )
BBR
;;
4 )
Netflix
;;
5 )
v646
;;
6 )
v64
;;
7 )
cwarp
;;
8 )
owarp
;;
9 )
4x86
;;
10 )
6x86
;;
11 )
status
;;
12 )
ipv4
;;
13 )
ipv6
;;
14 )
ssgo
;;
15 )
reboot
;;
0 )
exit 1
;;
esac
}
start_menu "first"
elif [[ ${bit} == "aarch64" ]]; then
#彩色
red(){
echo -e "\033[31m\033[01m$1\033[0m"
}
green(){
echo -e "\033[32m\033[01m$1\033[0m"
}
yellow(){
echo -e "\033[33m\033[01m$1\033[0m"
}
blue(){
echo -e "\033[36m\033[01m$1\033[0m"
}
function BBR(){
wget --no-check-certificate https://raw.githubusercontent.com/cx9208/Linux-NetSpeed/master/tcp.sh && chmod +x tcp.sh && ./tcp.sh
}
function cwarp(){
systemctl stop wg-quick@wgcf
systemctl disable wg-quick@wgcf
reboot
}
function owarp(){
systemctl enable wg-quick@wgcf
systemctl start wg-quick@wgcf
}
function ssgo(){
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/ss-go.sh && chmod +x ss-go.sh && bash ss-go.sh
}
function ss(){
wget -N --no-check-certificate -c -t3 -T60 -O ss-plugins.sh https://git.io/fjlbl
chmod +x ss-plugins.sh
./ss-plugins.sh
}
function ipv4(){
curl -4 ip.p3terx.com
}
function ipv6(){
curl -6 ip.p3terx.com
}
function Netflix(){
wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.6/nf_2.6_linux_arm64 && chmod +x nf && clear && ./nf -method full
}
function reboot(){
sudo reboot
}
function dns(){
echo 'DNS=2a00:1098:2c::1'>> /etc/systemd/resolved.conf
systemctl restart systemd-resolved
systemctl enable systemd-resolved
mv /etc/resolv.conf /etc/resolv.conf.bak
ln -s /run/systemd/resolve/resolv.conf /etc/
sudo reboot
}
function arm5.11(){
cd /tmp
wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/arm64/linux-headers-5.11.0-051100-generic_5.11.0-051100.202102142330_arm64.deb
wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/arm64/linux-image-unsigned-5.11.0-051100-generic_5.11.0-051100.202102142330_arm64.deb
wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/arm64/linux-modules-5.11.0-051100-generic_5.11.0-051100.202102142330_arm64.deb
sudo dpkg -i *.deb
sudo apt -f install -y
sudo reboot
}
function v646(){
yellow " 检测当前内核版本 "
uname -r
main=`uname -r | awk -F . '{print $1 }'`
minor=`uname -r | awk -F . '{print $2}'`
if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then
red " 检测到内核版本小于5.6,为实现WARP网络效能最高的内核集成Wireguard方案,回到菜单,选择1,更新内核吧"
exit 1
fi
apt update
apt -y --no-install-recommends install openresolv dnsutils wireguard-tools
wget -N -6 https://cdn.jsdelivr.net/gh/xOS/Warp/wgcf
cp wgcf /usr/local/bin/wgcf
chmod +x /usr/local/bin/wgcf
echo | wgcf register
wgcf generate
sed -i "5 s/^/PostUp = ip -6 rule add from $(wget -qO- ipv6.ip.sb) table main\n/" wgcf-profile.conf
sed -i "6 s/^/PostDown = ip -6 rule delete from $(wget -qO- ipv6.ip.sb) table main\n/" wgcf-profile.conf
sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf
sed -i 's/1.1.1.1/2001:4860:4860::8888,2001:4860:4860::8844,8.8.8.8,8.8.4.4/g' wgcf-profile.conf
cp wgcf-account.toml /etc/wireguard/wgcf-account.toml
cp wgcf-profile.conf /etc/wireguard/wgcf.conf
systemctl enable wg-quick@wgcf
systemctl start wg-quick@wgcf
rm -f wgcf*
grep -qE '^[ ]*precedence[ ]*::ffff:0:0/96[ ]*100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf
yellow " 检测是否成功启动(IPV4+IPV6)双栈Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) 显示IPV6地址:$(wget -qO- ipv6.ip.sb) "
green " 如上方显示IPV4地址:8.…………,IPV6地址:2a09:…………,则说明成功啦!\n 如上方IPV4无IP显示,IPV6显示本地IP(说明申请WGCF账户失败),请继续运行该脚本吧,直到成功为止!!! "
}
function v64(){
yellow " 检测当前内核版本 "
uname -r
main=`uname -r | awk -F . '{print $1 }'`
minor=`uname -r | awk -F . '{print $2}'`
if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then
red " 检测到内核版本小于5.6,为实现WARP网络效能最高的内核集成Wireguard方案,回到菜单,选择1,更新内核吧"
exit 1
fi
apt update
apt -y --no-install-recommends install openresolv dnsutils wireguard-tools
wget -N -6 https://cdn.jsdelivr.net/gh/xOS/Warp/wgcf
cp wgcf /usr/local/bin/wgcf
chmod +x /usr/local/bin/wgcf
echo | wgcf register
wgcf generate
sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf
sed -i '/\:\:\/0/d' wgcf-profile.conf
sed -i 's/1.1.1.1/2001:4860:4860::8888,2001:4860:4860::8844,8.8.8.8,8.8.4.4/g' wgcf-profile.conf
cp wgcf-account.toml /etc/wireguard/wgcf-account.toml
cp wgcf-profile.conf /etc/wireguard/wgcf.conf
systemctl enable wg-quick@wgcf
systemctl start wg-quick@wgcf
rm -f wgcf*
grep -qE '^[ ]*precedence[ ]*::ffff:0:0/96[ ]*100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf
yellow " 检测是否成功启动Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) "
green " 如上方显示IPV4地址:8.…………,则说明成功啦!\n 如上方显示VPS本地IP,(说明申请WGCF账户失败),请继续运行该脚本吧,直到成功为止!!! "
}
function status(){
systemctl status wg-quick@wgcf
}
function 6arm(){
wget -6 -N --no-check-certificate https://raw.githubusercontent.com/xOS/Warp/main/multiOV6.sh && chmod +x multiOV6.sh && ./multiOV6.sh
}
function 4arm(){
wget -4 -N --no-check-certificate https://raw.githubusercontent.com/xOS/Warp/main/multiOV6.sh && chmod +x multiOV6.sh && ./multiOV6.sh
}
#主菜单
function start_menu(){
clear
red " 围绕WARP功能的脚本,目前仅支持KVM ARM架构的纯IPV6 /Ubuntu 20.04系统,还在优化添加新功能中…… "
red " =============================================================================================="
yellow " 切记:进入脚本快捷方式 bash ~/multiOV6.sh "
blue " ===================================================================="
blue " 一、VPS状态调整选择及说明(更新中)"
blue " 1. 更新linux系统ARM架构通用版内核至5.11版。自动断连后,请重新连接SSH "
blue " 2. DNS64设置。自动断连后,请重新连接SSH(建议选择) "
blue " 3. 开启原生BBR加速(启用WARP后可执行) "
blue " 4. 检测奈飞Netflix是否解锁(启用WARP后可执行) "
green " ======================================================================="
green " 二、WARP功能选择(更新中)"
green " ----VPS原生IP数--------------添加WARP虚拟IP的位置-----------是否需要输入相关IP--------------"
green " 5. 纯IPV6的VPS。 添加WARP虚拟IPV4+虚拟IPV6 (无须输入IP地址!)"
green " 6. 纯IPV6的VPS。 添加WARP虚拟IPV4 (无须输入IP地址!)"
green " ------------------------------------------------------------------------------------------------"
green " 7. 永久关闭WARP功能。自动断连后,请重新连接SSH "
green " 8. 自动开启WARP功能 "
green " 9. 在WARP开启状态下更新脚本 "
green " 10. 在WARP关闭状态下更新脚本 "
green " 11. 查看当前WARP运行状态 "
green " 12. 查看VPS当前正在使用的IPV4地址 "
green " 13. 查看VPS当前正在使用的IPV6地址 "
yellow " ================================================================"
yellow " 三、支持ARM架构的代理协议脚本选择(更新中)"
yellow " 14.安装 Shadowsocks-Plugins "
yellow " ==============================================================================================="
red " 15. 重启VPS实例,请重新连接SSH "
red " =================================================================================================="
red " 0. 退出脚本 "
echo
read -p "请输入数字:" menuNumberInput
case "$menuNumberInput" in
1 )
arm5.11
;;
2 )
dns
;;
3 )
BBR
;;
4 )
Netflix
;;
5 )
v646
;;
6 )
v64
;;
7 )
cwarp
;;
8 )
owarp
;;
9 )
4arm
;;
10 )
6arm
;;
11 )
status
;;
12 )
ipv4
;;
13 )
ipv6
;;
14 )
ss
;;
15 )
reboot
;;
0 )
exit 1
;;
esac
}
start_menu "first"
else
echo "此CPU架构不是X86,也不是ARM!不支持!"
exit
fi