Deepin 20使用WireGuard梯子简单教程
Tofloor
poster avatar
A·S·M·X·T 😏😜
deepin
2020-04-20 22:12
Author
本帖最后由 liululin 于 2020-4-20 14:48 编辑

Wireguard是一个新的高性能VPN,它设计精巧,核心代码仅四千多行相对于OpenVPN、 IPSec等隧道程序来说,配置起来更加简单,运行速度也更快。

在我这至少比ss快,ss经常断连。

Wireguard的服务器可以自己买vps部署或者购买现成的,windows、ios、安卓的官方客户端有GUI好使用,但linux就不太友好了,服务端客户端都是一个命令行程序。


Deepin20客户端用法:


由于Deepin20源内没有Wireguard,所以借用一下debian 10的backports源安装。

添加源:
  1. echo "deb http://mirrors.ustc.edu.cn/debian buster-backports main contrib non-free" |sudo tee /etc/apt/sources.list.d/debian10-backports.list
Copy the Code

更新及安装:
  1. sudo apt update
Copy the Code
  1. sudo apt install wireguard resolvconf
Copy the Code
resolvconf是其后wg-quick启动时需要的组件。


添加客户端配置:
  1. sudo deepin-editor /etc/wireguard/wg0.conf
Copy the Code
客户端配置由自己的服务端生成或者购买获取。


示例,如:

[Interface]
PrivateKey = QJAWG0EVyt7DXfzK49KBniRm2XS698ptNr9wLfX4qG8=
Address = 10.10.10.3
DNS = 8.8.8.8


[Peer]
PublicKey = pJyCyGG5NAyqQte62JZ2d4tUDy1B06Y4kloQetAP/T0=
Endpoint = 149.28.171.194:54321
AllowedIPs = 0.0.0.0/0


[Interface] 部分配置了 Google DNS,用于防止域名污染。
[Peer] 即对应 VPS服务器。
配置 Endpoint 为 VPS 公网 IP 和对应的 ListenPort 即 端口54321。
AllowedIPs 配置为 0.0.0.0/0 用于将所有流量都路由到 VPS,相当于全局代理


配置保存后:
使用 wg-quick up wg0 根据配置文件快速创建 wg0 虚拟网卡启用代理
使用 wg-quick down wg0 删除虚拟网卡关闭代理
使用 wg 查看各个节点的状态。


如果官方能在网络管理器-代理里集成WireGuard就好了 :)

相关项目:
https://github.com/max-moser/network-manager-wireguard


@jingle















Reply Favorite View the author
All Replies
avatar
ksplite
deepin
2020-04-20 22:58
#1
封 号 斗 罗
Reply View the author