wg-quick systemd service does not work directly after boot

Celti Burroughs celti at celti.name
Wed Feb 7 13:08:32 CET 2018


On Wed, 7 Feb 2018 10:03:43 +0100
Henning Reich <henning.reich at gmail.com> wrote:

> Hi,
> 
> I'm not sure if this a problem of wg/wg-quick or my system but maybe
> somebody can help.
> [snip] 
> It looks for me like wireguard can't resolve my remote site at this
> moment. I tried a static resolv.conf file and also systemd-resolved.
> Both sites have dynamic IPs so I can't use direct IPs.
> If I run "systemctl restart wg-quick at wg0" it works as expected, so my
> workaround is to add a 'sleep 5' to the service file.
> 
> Any better solutions or is this a "bug"?
> 
> Merci

wg-quick at .service orders itself After=network-online.target. Systemd
will only activate this target once it knows the network is online,
which it can only know if your network manager tells it that. You'll
need to enable the appropriate service:
  NetworkManager-wait-online.service
  systemd-networkd-wait-online.service
  ifup-wait-all-auto.service

Enable whichever of those is appropriate for your configuration,
reboot, and see if it works this time.

~Celti
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/wireguard/attachments/20180207/1408e7fd/attachment.asc>


More information about the WireGuard mailing list