[App Sharing] deepin v20.7可用的wireguard-tools
Tofloor
poster avatar
myml
Super Moderator
Developer
2022-09-29 17:45
Author

wireguard是集成在Linux内核的,deepin用的内核就有,只是系统仓库没有wireguard-tools,手动创建网卡操作很麻烦,debian仓库的deb包因为依赖不满足,无法直接安装。就在github找到了wireguard-tools的源码,再加上linuxdeepin里面的构建脚本,用github action编译了deepin可用的wireguard-tools安装包。仓库地址是 https://github.com/myml/wireguard-tools

我自己用着没问题,分享给大家:

wireguard-tools_1.0.20210914+r466+g7f3cd52-1_amd64.zip

Reply Favorite View the author
All Replies
xuqi
deepin testing team
2022-09-29 17:49
#1

like

Reply View the author
deepin-superuser
deepin
2022-09-29 23:12
#2

v23 + v20.7 = v27

Reply View the author
myml
Super Moderator
Developer
2022-09-30 01:05
#3
deepin-superuser

v23 + v20.7 = v27

😄 就是你想的那样,标题改了

Reply View the author
wupluspro
deepin
2022-10-01 02:59
#4

666

Reply View the author
myml
Super Moderator
Developer
2022-12-20 17:51
#5
It has been deleted!
186******45
deepin
2023-08-05 02:35
#6

版主 安装之后没有快捷方式 怎么打开

Reply View the author
myml
Super Moderator
Developer
2023-08-07 17:54
#7
186******45

版主 安装之后没有快捷方式 怎么打开

wireguard不是可视化的应用啊,是不是看错软件了

Reply View the author
186******45
deepin
2023-09-12 07:34
#8
myml

wireguard不是可视化的应用啊,是不是看错软件了

请教版主怎么配置

Reply View the author
myml
Super Moderator
Developer
2023-09-12 17:23
#9

可以参考 https://wiki.archlinuxcn.org/wiki/WireGuard
网页右上角可以切换到中文

Reply View the author
齿轮
deepin
2023-12-28 17:28
#10

大佬,服务端的我不说好了。windows的我也能连接上了。帖子里面刚安装了,这个怎么用呀,我sudo wg 没反应。

Reply View the author
myml
Super Moderator
Developer
2023-12-28 10:16
#11

在 /etc/wireguard/ 下创建一个配置文件,文件名可以自己定义,比如我习惯用 wg0.conf 这样的。

客户端 /etc/wireguard/wg0.conf

[Interface]
Address = 192.168.xxx.xxx/32
PrivateKey = xxx

[Peer]
Endpoint = xxx
AllowedIPs = 192.168.xxx.xxx/32
PublicKey = xxx
PersistentKeepalive = 60

服务端 /etc/wireguard/wg0.conf

[Interface]
Address = 192.168.xxx.xxx/32
ListenPort = 13140
PrivateKey = xxx

[Peer]
AllowedIPs = 192.168.xxx.xxx/32
PublicKey = xxx

里面的私钥可以使用 wg genkey 生成,公钥用 echo 私钥 | wg pubkey 生成。

服务端和客户端分别有自己的私钥,并在peer中填写对方的公钥,这就是非对称加密。

双方的 AllowedIPs 分别填对方的 Address ,这个 Address 是可以随便写的,但最好不要和现有的局域网网段冲突,这个配置项可以实现更多的高级组网方式,可以参考其他文章。

Endpoint 是客户端需要配置的,填写服务端的ip和端口,如果客户端有IP的话,服务端也可以配置这个参数,因为wg是点对点的,客户端和服务端是对等的两个节点,没有太大的区别。

如果需要别人连接的话,就需要加上 ListenPort 不然是随机使用一个,其他节点没法填 endpoint

如果只有一方配置了 Endpoint 就需要加 PersistentKeepalive ,让客户端各一段时间发送一次心跳,不然服务端不知道客户端的ip,就没法主动发起链接,如果双方都配置了 Endpoint,PersistentKeepalive 选项可以不配置

配置添加后,双方使用 systemctl start wg-quick@wg0 启动,然后就可以用 sudo wg 命令看到连接信息了。需要开机自启动,还要使用 systemctl enable wg-quick@wg0

Reply View the author
齿轮
deepin
2024-01-03 04:47
#12
myml

在 /etc/wireguard/ 下创建一个配置文件,文件名可以自己定义,比如我习惯用 wg0.conf 这样的。

客户端 /etc/wireguard/wg0.conf

[Interface]
Address = 192.168.xxx.xxx/32
PrivateKey = xxx

[Peer]
Endpoint = xxx
AllowedIPs = 192.168.xxx.xxx/32
PublicKey = xxx
PersistentKeepalive = 60

服务端 /etc/wireguard/wg0.conf

[Interface]
Address = 192.168.xxx.xxx/32
ListenPort = 13140
PrivateKey = xxx

[Peer]
AllowedIPs = 192.168.xxx.xxx/32
PublicKey = xxx

里面的私钥可以使用 wg genkey 生成,公钥用 echo 私钥 | wg pubkey 生成。

服务端和客户端分别有自己的私钥,并在peer中填写对方的公钥,这就是非对称加密。

双方的 AllowedIPs 分别填对方的 Address ,这个 Address 是可以随便写的,但最好不要和现有的局域网网段冲突,这个配置项可以实现更多的高级组网方式,可以参考其他文章。

Endpoint 是客户端需要配置的,填写服务端的ip和端口,如果客户端有IP的话,服务端也可以配置这个参数,因为wg是点对点的,客户端和服务端是对等的两个节点,没有太大的区别。

如果需要别人连接的话,就需要加上 ListenPort 不然是随机使用一个,其他节点没法填 endpoint

如果只有一方配置了 Endpoint 就需要加 PersistentKeepalive ,让客户端各一段时间发送一次心跳,不然服务端不知道客户端的ip,就没法主动发起链接,如果双方都配置了 Endpoint,PersistentKeepalive 选项可以不配置

配置添加后,双方使用 systemctl start wg-quick@wg0 启动,然后就可以用 sudo wg 命令看到连接信息了。需要开机自启动,还要使用 systemctl enable wg-quick@wg0

大佬。根据这个步骤操作。也是提示报错。resolvconf一安装就会把deepin搞崩掉。有办法解决吗?

$ sudo wg-quick up wg0
Warning: `/etc/wireguard/wg0.conf' is world accessible
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.0.8.2/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
/usr/bin/wg-quick: line 32: resolvconf: command not found
[#] ip link delete dev wg0

Reply View the author
myml
Super Moderator
Developer
2024-01-02 20:51
#13
齿轮

大佬。根据这个步骤操作。也是提示报错。resolvconf一安装就会把deepin搞崩掉。有办法解决吗?

$ sudo wg-quick up wg0
Warning: `/etc/wireguard/wg0.conf' is world accessible
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.0.8.2/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
/usr/bin/wg-quick: line 32: resolvconf: command not found
[#] ip link delete dev wg0

你是不是在wg0.conf文件里面配置dns了?我试着没有调用resolveconf

图片.png

Reply View the author
myml
Super Moderator
Developer
2024-01-02 21:01
#14

我之前倒是没有试过在电脑上的wg添加DNS的配置。看来在deepin15上,这个选项不能用。你可以用他的PostUp,在这个里面写脚本手动修改resolve.conf文件
也可以安装一个dnsmasq服务,dnsmasq可以设置多个上游,让dnsmasq优先用wg的,然后用本地的

Reply View the author
齿轮
deepin
2024-02-29 23:08
#15

大佬方便远程指导一下吗?我装的老是破坏了deepin系统

Reply View the author
myml
Super Moderator
Developer
2024-03-01 09:10
#16
齿轮

大佬方便远程指导一下吗?我装的老是破坏了deepin系统

把wg.conf里面DNS配置去掉,就不用安装 resolvconf,不安装这个还会破坏系统吗?

Reply View the author
齿轮
deepin
2024-03-01 15:24
#17
myml

把wg.conf里面DNS配置去掉,就不用安装 resolvconf,不安装这个还会破坏系统吗?

向大佬低头。删除了dns配置就OK了。

我重启电脑看看。会不会崩。

Reply View the author