打破次元壁,腾讯云轻量配置Warp实现IPv6访问

众所周知,腾讯云清凉价格实惠,深受网友喜爱,但其对于IPv6的支持并不友好,得益于Cloudflare在海外优秀的连接速度,我们可以使用Cloudflare Warp对其桥接实现IPv6连接

安装BBR

这一步其实可有可无,但是安装BBR可以有效提高网络速度

1
wget -N "https://github.000060000.xyz/tcp.sh" && chmod +x tcp.sh && ./tcp.sh

出现这一界面时输入1,回车,安装bbr内核,输入Y重启 再次刷入如下命令

1
wget -N "https://github.000060000.xyz/tcp.sh" && chmod +x tcp.sh && ./tcp.sh

输入12,回车后reboot重启

安装WireGuard

配置Warp安装WireGuard是必不可少的,但是在CentOS7上,WireGuard的安装较为复杂,官方给出了三种安装方法 博主测试第三种安装方法最为方便,且不影响BBR,于是乎这里建议选择第三种方法:

1
2
3
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo
sudo yum install wireguard-dkms wireguard-tools

中间若有提示一律按y回车 接着运行以下命令检查安装状态:

1
2
modprobe wireguard  #加载wireguard模块
lsmod grep wireguard #查看模块状态

若有返回结果,即为安装成功

安装WGCF

1
2
3
4
mkdir wgcf #新建文件夹
cd wgcf
wget -O wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.3/wgcf_2.2.3_linux_amd64 #下载程序
chmod +x wgcf #修改权限

若中途无报错即为安装成功

配置文件

先注册一下Warp的账户

1
./wgcf register

若出现这样的界面直接回车即可 然后输入./wgcf generate,检查目录下是否出现名为wgcf-profile.conf的文件,内容大概这样

1
2
3
4
5
6
7
8
9
10
11
[Interface]
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Address = 172.16.0.2/32
Address = fd01:5ca1:ab1e:8a15:6634:bea7:4f74:47d9/128
DNS = 1.1.1.1
MTU = 1280
[Peer]
PublicKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AllowedIPs = 0.0.0.0/0
AllowedIPs = ::/0
Endpoint = engage.cloudflareclient.com:2408

输入nano  wgcf-profile.conf 修改配置,删除第九行AllowedIPs = 0.0.0.0/0 ,Ctrl+X保存 接着输入如下代码,运行WGCF并设置开机自启动

1
2
3
sudo cp wgcf-profile.conf /etc/wireguard/wgcf.conf
sudo systemctl start wg-quick@wgcf
sudo systemctl enable wg-quick@wgcf

测试连接

SSH输入ping 2001:4860:4860::8888 -6 ,若连接正常即为配置成功

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=119 time=4.68 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=119 time=2.21 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=119 time=2.18 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=119 time=2.22 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=5 ttl=119 time=2.15 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=6 ttl=119 time=2.22 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=7 ttl=119 time=2.19 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=8 ttl=119 time=2.21 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=9 ttl=119 time=2.16 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=10 ttl=119 time=2.19 ms

--- 2001:4860:4860::8888 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9010ms
rtt min/avg/max/mdev = 2.159/2.446/4.686/0.748 ms

参考

  1. 【WGCF】提取WARP配置为CERNET提供IPv6流量转发
  2. Euserv正确打开优化方式

打破次元壁,腾讯云轻量配置Warp实现IPv6访问

http://www.oplog.cn/archives/23543.html

作者

啊不都

发布于

2021-04-04

更新于

2022-06-23

许可协议

CC BY 4.0

评论

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×