Re: Ordering wireguard interface init and daemon start

Vincent Lee <[email protected]>
Newsgroups gmane.linux.debian.user
Message-ID <[email protected]>
Hey Nicolas,

Nicolas George <[email protected]> writes:

> I am not seeing anything in your config that is supposed to ensure
> that. Are you sure you did it? If so, please share or emphasize exactly
> how.

Thanks for pointing this out. I noticed I had allow-hotplug on enp1s0
and auto on wg0, which imposes no ordering constraint.

I tried again with both interfaces configured as auto, which from my
understanding means they should start one after another. However, it
still didn't work (logs below)

>
> One question: what do the logs say?
>
> Use journalctl to get the logs of around the time the network comes up,
> remove everything that is unrelated, and look, the answer is likely to
> be obvious.
>
> Complement that with looking at systemctl status on all the services
> involved, starting with networking.service, so that you do not
> accidentally miss something.
>
> When it happened to me, the answer was the wg interface came
> up before the main interface and the DNS resolution for the wg endpoint
> failed. All that was absolutely documented in the logs.
>

This was it. My wg0 interface is configured using a hostname as the
peer, and the networking.service logs say it failed to resolve the
hostname:

ifup[946]: Temporary failure in name resolution: `<redacted>:51820'. Trying again in 1.00 seconds...

I'm surprised that's the case even if I order the wg0 interface after
the enp1s0 one in the interfaces file.

In the meantime, the IP address of the WG peer is fixed, so I'm just
going to hardcode it in the config, but I'm curious how you fixed it in
your case.

Thanks,
Vincent
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.