debian setup wireguard-client
I have such an error. What could be the problem?
sudo wg-quick up wg0-client
[#] ip link add wg0-client type wireguard
[#] wg setconf wg0-client /dev/fd/63
[#] ip -4 address add 10.8.0.2/32 dev wg0-client
[#] ip link set mtu 1420 up dev wg0-client
[#] resolvconf -a tun.wg0-client -m 0 -x
Unknown interface 'tun': No such device
[#] ip link delete dev wg0-client
I managed to move forward a bit. Reinstalled resolvconf on openresolv:
apt-get --purge remove resolvconf
apt install openresolv
I executed the command the result of which is Active: inactive (dead):
systemctl status systemd-resolved.service
I executed the second command, the result of which was Active: active (running):
systemctl enable systemd-resolved.service
systemctl start systemd-resolved.service
After which the wg client wound up:
sudo wg-quick up wg0-client
But now another problem. When the system boots, wg0-client.service throws an error. This must be done after booting the system:
systemctl restart wg-quick@wg0-client.service
Here is the output from the boot log:
grep -i wg /var/log/boot.log
[FAILED] Failed to start WireGuard via wg-quick(8) for wg/client.
See 'systemctl status wg-quick@wg-client.service' for details.
systemctl status wg-quick@wg-client.service:
systemctl status wg-quick@wg-client.service
● wg-quick@wg-client.service - WireGuard via wg-quick(8) for wg/client
Loaded: loaded (/lib/systemd/system/wg-quick@.service; enabled; vendor preset: enabled)
Active: **failed** (Result: exit-code) since Tue 2020-06-30 17:10:56 MSK; 2 weeks 1 days ago
Docs: man:wg-quick(8)
man:wg(8)
https://www.wireguard.com/
https://www.wireguard.com/quickstart/
https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
Main PID: 564 (code=exited, status=1/FAILURE)
июн 30 17:10:56 PC systemd[1]: Starting WireGuard via wg-quick(8) for wg/client...
июн 30 17:10:56 PC wg-quick[564]: wg-quick: `/etc/wireguard/wg-client.conf' does not exist
июн 30 17:10:56 PC systemd[1]: wg-quick@wg-client.service: Main process exited, code=exited, status=1/FAILURE
июн 30 17:10:56 PC systemd[1]: wg-quick@wg-client.service: Failed with result 'exit-code'.
июн 30 17:10:56 PC systemd[1]: **Failed to start WireGuard via wg-quick(8) for wg/client**.
But I do not have a configuration file with that name: wg-quick: `/etc/wireguard/wg-client.conf' does not exist
ls /etc/wireguard
client_private.key client_public.key wg0-client.conf
As a result, the last problem was solved. By mistake, a non-existent interface service was created:
systemctl stop wg-quick@wg-client.service
systemctl disable wg-quick@wg-client.service
systemctl enable wg-quick@wg0-client.service
systemctl start wg-quick@wg0-client.service
systemctl status wg-quick@wg0-client.service
● wg-quick@wg0-client.service - WireGuard via wg-quick(8) for wg0/client
Loaded: loaded (/lib/systemd/system/wg-quick@.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2020-07-15 18:33:52 MSK; 5s ago
Docs: man:wg-quick(8)
man:wg(8)
https://www.wireguard.com/
https://www.wireguard.com/quickstart/
https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
Process: 1544 ExecStart=/usr/bin/wg-quick up wg0-client (code=exited, status=0/SUCCESS)
Main PID: 1544 (code=exited, status=0/SUCCESS)
июл 15 18:33:52 PC wg-quick[1544]: [#] ip -4 address add 10.8.1.1/32 dev wg0-client
июл 15 18:33:52 PC wg-quick[1544]: [#] ip link set mtu 1420 up dev wg0-client
июл 15 18:33:52 PC wg-quick[1544]: [#] resolvconf -a wg0-client -m 0 -x
июл 15 18:33:52 PC wg-quick[1544]: [#] wg set wg0-client fwmark 51820
июл 15 18:33:52 PC wg-quick[1544]: [#] ip -4 route add 0.0.0.0/0 dev wg0-client table 51820
июл 15 18:33:52 PC wg-quick[1544]: [#] ip -4 rule add not fwmark 51825 table 51825
июл 15 18:33:52 PC wg-quick[1544]: [#] ip -4 rule add table main suppress_prefixlength 0
июл 15 18:33:52 PC wg-quick[1544]: [#] sysctl -q net.ipv4.conf.all.src_valid_mark=1
июл 15 18:33:52 PC wg-quick[1544]: [#] iptables-restore -n
июл 15 18:33:52 PC systemd[1]: Started WireGuard via wg-quick(8) for wg0/client.