All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: wg-quick systemd service does not work directly after boot
@ 2018-02-07 11:54 Mytril
  2018-02-07 13:06 ` Matthias Urlichs
  0 siblings, 1 reply; 5+ messages in thread
From: Mytril @ 2018-02-07 11:54 UTC (permalink / raw)
  To: wireguard

Hi,

i have the same problem with the normal way over debian interface.

The interface cannot resolve the dynamic domain, because the internet
connection is not established at this moment.

But i have also only a workaround to create wg0. I also start the wg at
a later time.

So i think this is not a bug, but rather a problem with the order of
network connection startup.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wg-quick systemd service does not work directly after boot
  2018-02-07 11:54 wg-quick systemd service does not work directly after boot Mytril
@ 2018-02-07 13:06 ` Matthias Urlichs
  2018-02-08 19:14   ` jugs
  0 siblings, 1 reply; 5+ messages in thread
From: Matthias Urlichs @ 2018-02-07 13:06 UTC (permalink / raw)
  To: wireguard

On 07.02.2018 12:54, Mytril wrote:
> The interface cannot resolve the dynamic domain, because the internet
> connection is not established at this moment.
>
> But i have also only a workaround to create wg0. I also start the wg at
> a later time.
>
> So i think this is not a bug, but rather a problem with the order of
> network connection startup.
Right. There cannot be a "correct" way of ordering wireguard vs. other
interfaces that works in all circumstances.

However, instead of sleeping, a dependency on network-online.target
might be more appropriate if wireguard needs to resolve a name.

-- 
-- Matthias Urlichs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wg-quick systemd service does not work directly after boot
  2018-02-07 13:06 ` Matthias Urlichs
@ 2018-02-08 19:14   ` jugs
  0 siblings, 0 replies; 5+ messages in thread
From: jugs @ 2018-02-08 19:14 UTC (permalink / raw)
  Cc: wireguard

Or just use the IP address in the config?

=E2=80=8B-jugs

=E2=80=8B

-------- Original Message --------
 On February 7, 2018 1:06 PM, Matthias Urlichs <matthias@urlichs.de> wrote:

>On 07.02.2018 12:54, Mytril wrote:
>>The interface cannot resolve the dynamic domain, because the internet
>> connection is not established at this moment.
>>But i have also only a workaround to create wg0. I also start the wg at
>> a later time.
>>So i think this is not a bug, but rather a problem with the order of
>> network connection startup.
>>
>Right. There cannot be a "correct" way of ordering wireguard vs. other
> interfaces that works in all circumstances.
>
> However, instead of sleeping, a dependency on network-online.target
> might be more appropriate if wireguard needs to resolve a name.
>
>
>-- Matthias Urlichs
>
>
>WireGuard mailing list
>WireGuard@lists.zx2c4.com
>https://lists.zx2c4.com/mailman/listinfo/wireguard
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wg-quick systemd service does not work directly after boot
  2018-02-07  9:03 Henning Reich
@ 2018-02-07 12:08 ` Celti Burroughs
  0 siblings, 0 replies; 5+ messages in thread
From: Celti Burroughs @ 2018-02-07 12:08 UTC (permalink / raw)
  To: wireguard

[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]

On Wed, 7 Feb 2018 10:03:43 +0100
Henning Reich <henning.reich@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@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@.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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* wg-quick systemd service does not work directly after boot
@ 2018-02-07  9:03 Henning Reich
  2018-02-07 12:08 ` Celti Burroughs
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Reich @ 2018-02-07  9:03 UTC (permalink / raw)
  To: wireguard

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

Hi,

I'm not sure if this a problem of wg/wg-quick or my system but maybe
somebody can help.

I have a wg0.conf for wg-quick and enabled the systemd service (systemctl
enable wg-quick@wg0).
After a reboot, I have the following status of this service:
--
Feb 07 08:15:13 domain.de systemd[1]: Starting WireGuard via wg-quick(8)
for wg0...
Feb 07 08:15:14 domain.de wg-quick[335]: [#] ip link add wg0 type wireguard
Feb 07 08:15:14 domain.de wg-quick[335]: [#] wg setconf wg0 /dev/fd/63
Feb 07 08:15:14 domain.de wg-quick[335]: Name or service not known: `
remote.de:25555'
Feb 07 08:15:14 domain.de wg-quick[335]: Configuration parsing error
Feb 07 08:15:14 domain.de wg-quick[335]: [#] ip link delete dev wg0
Feb 07 08:15:14 domain.de systemd[1]: wg-quick@wg0.service: Main process
exited, code=exited, status=1/FAILURE
Feb 07 08:15:14 domain.de systemd[1]: wg-quick@wg0.service: Failed with
result 'exit-code'.
Feb 07 08:15:14 domain.de systemd[1]: Failed to start WireGuard via
wg-quick(8) for wg0.

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@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

[-- Attachment #2: Type: text/html, Size: 4291 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-08 19:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 11:54 wg-quick systemd service does not work directly after boot Mytril
2018-02-07 13:06 ` Matthias Urlichs
2018-02-08 19:14   ` jugs
  -- strict thread matches above, loose matches on Subject: below --
2018-02-07  9:03 Henning Reich
2018-02-07 12:08 ` Celti Burroughs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.