Debian Wireguard
wireguard远程办公其实还是蛮爽的,安装比较简单
安装
sudo apt-get update
sudo apt-get install wireguard
配置
然后把你们网管给你的私钥放在/etc/wireguard/wg0.conf
sudo vim /etc/wireguard/wg0.conf
配置文件大概这样
echo "
[Interface]
PrivateKey = $(cat client_privatekey)
Address = 10.0.0.2/24
DNS = 8.8.8.8
MTU = 1420
[Peer]
PublicKey = $(cat server_publickey)
Endpoint = 1.2.3.4:50814
AllowedIPs = 0.0.0.0/0, ::0/0
PersistentKeepalive = 25 " > client.conf
你的ifconfig信息大概这样
➜ ifconfig ✔ 23:29:15
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
XHC20: flags=0<> mtu 0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=6b<RXCSUM,TXCSUM,VLAN_HWTAGGING,TSO4,TSO6>
ether 80:fa:5b:64:6e:a6
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (<unknown type>)
status: inactive
en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 18:4f:32:f4:7e:a3
inet6 fe80::1c97:67ed:68fb:d0ee%en1 prefixlen 64 secured scopeid 0x6
inet6 2408:8207:c9a:2db0:1b:b572:56e0:4cac prefixlen 64 autoconf secured
inet6 2408:8207:c9a:2db0:a0f4:631b:7637:1b83 prefixlen 64 autoconf temporary
inet 10.10.10.5 netmask 0xffffff00 broadcast 10.10.10.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether 0a:4f:32:f4:7e:a3
media: autoselect
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether 5a:14:bb:ea:17:7a
inet6 fe80::5814:bbff:feea:177a%awdl0 prefixlen 64 scopeid 0x8
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
inet6 fe80::2c3b:78b4:b948:a51f%utun0 prefixlen 64 scopeid 0x9
nd6 options=201<PERFORMNUD,DAD>
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
inet6 fe80::83f5:8460:590a:6ae1%utun1 prefixlen 64 scopeid 0xa
nd6 options=201<PERFORMNUD,DAD>
vnic0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether 00:1c:42:00:00:08
inet 10.211.55.2 netmask 0xffffff00 broadcast 10.211.55.255
media: autoselect
status: active
vnic1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether 00:1c:42:00:00:09
inet 10.37.129.2 netmask 0xffffff00 broadcast 10.37.129.255
media: autoselect
status: active
启动
wg-qucik up wg0
wg-quick down wg0
问题
我后来尝试在manjaro上部署wireguard,但是wireguard告诉我,不支持我的内核,窝头。。。
解决方法
当我执行以下命令检查内核模块的时候,告诉我没有。
modprobe wireguard && lsmod | grep wireguard
modprobe: FATAL: Module wireguard not found
查看内核版本
uanme -a
Linux lazy 5.3.18-1-MANJARO #1 SMP PREEMPT Wed Dec 18 18:34:35 UTC 2019 x86_64 GNU/Linux
sudo apt-get install linux-headers
他会提示一些内核版本,你需装符合你内核版本的linux-header即可
这次再去启动,就没有问题了