生成私钥
$ umask 077 $ wg genkey > privatekey
由私钥生成公钥
$ wg pubkey < privatekey > publickey
一次性生成私钥和公钥
$ wg genkey | tee privatekey | wg pubkey > publickey
生成私钥
$ umask 077 $ wg genkey > privatekey
由私钥生成公钥
$ wg pubkey < privatekey > publickey
一次性生成私钥和公钥
$ wg genkey | tee privatekey | wg pubkey > publickey
客户端标准配置文件
[Interface]
PrivateKey =
Address = 172.16.0.1/24
DNS = 8.8.8.8, 8.8.4.4
[Peer]
PublicKey =
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = hostname.com:51820
PersistentKeepalive = 25
生成二维码
方式1
$ qrencode -t ansiutf8 -r client.conf
方式2
$ qrencode -t ansiutf8 < client.conf
方式3
$ qrencode -t png -o client.png -r client.conf
启动接口异常
[root@localhost ~]# wg-quick up wg0 [#] ip link add wg0 type wireguard Error: Unknown device type. Unable to access interface: Protocol not supported [#] ip link delete dev wg0 Cannot find device "wg0" [root@localhost ~]#
手动加载内核模块异常
[root@localhost ~]# modprobe wireguard modprobe: ERROR: could not insert 'wireguard': Required key not available [root@localhost ~]#
禁用ESXi客户机Secure Boot的选项
重启系统后接口启动恢复正常