安装wireguard

安装使用wireguard

下载并运行

curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
chmod +x wireguard-install.sh
./wireguard-install.sh

客户端直接导入/etc/wireguard/client.conf文件

windows客户端地址

https://github.com/WireGuard/wireguard-windows

linux客户端地址

ubuntu已经自带了

sudo apt update
sudo apt install wireguard-tools

sudo wg-quick up config-path  # 启动
sudo wg-quick down config-path  # 停止
sudo wg show  # 查看连接状态

使用udp2raw中转加速

为什么要使用udp2raw?

wireguard使用的是udp连接,但服务商有时候会对udp限速,原因就是这类VPN使用了UDP协议。

udp2raw可以让udp协议伪装成tcp连接,绕过检测,对于大文件下载有明显提速。

git地址 https://github.com/wangyu-/udp2raw

windows版本 https://github.com/wangyu-/udp2raw-multiplatform

安装:

需要勾选 Install Npcap in WinPcap API-compatible Mode Support raw 802.11 traffic (and monitor mode) for wireless adapters

若提示cant not open wpcap.dll, make sure winpcap/npcap is installed

需要安装npcap-1.82.exe

windows客户端

udp2raw_mp.exe -c -l127.0.0.1:61361 -r47.108.78.65:61360 -k "your_strong_password_123" --raw-mode faketcp --cipher-mode aes128cbc --seq-mode 2 --fix-gro

Endpoint = 127.0.0.1:61362 # 指向本地udp2raw

linux客户端

udp2raw -c -l127.0.0.1:61361 -r47.108.78.65:61360 -k "your_strong_password_123" --raw-mode faketcp --cipher-mode aes128cbc --seq-mode 2 --fix-gro -a

Endpoint = 127.0.0.1:61361 # 指向本地udp2raw

Linux服务器

udp2raw -s -l0.0.0.0:61360 -r127.0.0.1:61359 -k "your_strong_password_123" --raw-mode faketcp --cipher-mode aes128cbc --seq-mode 2 --fix-gro -a

解释:服务器运行监听0.0.0.0:61360端口,并转发到wireguard的61359端口。

客户端监听本地的127.0.0.1:61362 or 127.0.0.1:61361端口,连接到服务器的61360端口。

若使用udp2raw加速,在wireguard客户端配置中,修改Endpoint字段为127.0.0.1:61361

即:wireguard客户端先连接到本地的udp2raw软件,由udp2raw客户端连接到udp2raw服务器,udp2raw服务器再将数据转给wireguard服务器。

整个过程增加了几次中转,单次ping感觉会增加延迟,但大文件下载可由速度200KB/s提升到4-10MB/s(实测)

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注