wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* wg-quick systemd service doesn't work after boot
@ 2019-10-06 16:54 Adrián Mihálko
  2019-10-06 18:13 ` Lonnie Abelbeck
  0 siblings, 1 reply; 2+ messages in thread
From: Adrián Mihálko @ 2019-10-06 16:54 UTC (permalink / raw)
  To: wireguard


[-- Attachment #1.1: Type: text/plain, Size: 1576 bytes --]

I have 3 wg interface on my server, but I am unable to enable wg0 with
wg-quick at boot:

@ubuntu:~$ sudo systemctl enable wg-quick@wg0
@ubuntu:~$

Oct 06 13:22:51 ubuntu systemd[1]: Starting WireGuard via wg-quick(8) for
wg0...
Oct 06 13:22:51 ubuntu wg-quick[1737]: Warning: `/etc/wireguard/wg0.conf'
is world accessible
Oct 06 13:22:52 ubuntu wg-quick[1737]: [#] ip link add wg0 type wireguard
Oct 06 13:22:52 ubuntu wg-quick[1737]: [#] wg setconf wg0 /dev/fd/63
Oct 06 13:22:52 ubuntu wg-quick[1737]: [#] ip -4 address add 192.168.5.2/24
dev wg0
Oct 06 13:22:52 ubuntu wg-quick[1737]: [#] ip link set mtu 1420 up dev wg0
Oct 06 13:22:53 ubuntu wg-quick[1737]: [#] ip -4 route add 192.168.2.0/24
dev wg0
Oct 06 13:22:53 ubuntu wg-quick[1737]: [#] iptables -A FORWARD -i wg0 -j
ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A
POSTROUTING -o e
*Oct 06 13:22:53 ubuntu wg-quick[1737]: Another app is currently holding
the xtables lock. Perhaps you want to use the -w option?*
Oct 06 13:22:53 ubuntu wg-quick[1737]: [#] ip link delete dev wg0
Oct 06 13:22:53 ubuntu systemd[1]: wg-quick@wg0.service: Main process
exited, code=exited, status=1/FAILURE
Oct 06 13:22:53 ubuntu systemd[1]: Failed to start WireGuard via
wg-quick(8) for wg0.
Oct 06 13:22:53 ubuntu systemd[1]: wg-quick@wg0.service: Unit entered
failed state.
Oct 06 13:22:53 ubuntu systemd[1]: wg-quick@wg0.service: Failed with result
'exit-code'.

As you can see it fails at iptables command.

wg0, wg2 fails with this problem, but wg1 starts without problem (same
config, with iptables command).

[-- Attachment #1.2: Type: text/html, Size: 1983 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

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

* Re: wg-quick systemd service doesn't work after boot
  2019-10-06 16:54 wg-quick systemd service doesn't work after boot Adrián Mihálko
@ 2019-10-06 18:13 ` Lonnie Abelbeck
  0 siblings, 0 replies; 2+ messages in thread
From: Lonnie Abelbeck @ 2019-10-06 18:13 UTC (permalink / raw)
  To: WireGuard mailing list



> On Oct 6, 2019, at 11:54 AM, Adrián Mihálko <adriankoooo@gmail.com> wrote:
> 
> I have 3 wg interface on my server, but I am unable to enable wg0 with wg-quick at boot:
> 
> @ubuntu:~$ sudo systemctl enable wg-quick@wg0
> @ubuntu:~$ 
> ...

> Oct 06 13:22:53 ubuntu wg-quick[1737]: [#] iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o e
> Oct 06 13:22:53 ubuntu wg-quick[1737]: Another app is currently holding the xtables lock. Perhaps you want to use the -w option?


Hi Adrián,

As a test, how about adding -w to the iptables call:
--
iptables -w -A FORWARD -i wg0 ...
--
and see it that fixes it.

With -w, iptables will wait until the lock is released.

Lonnie

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

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

end of thread, other threads:[~2019-10-06 18:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-06 16:54 wg-quick systemd service doesn't work after boot Adrián Mihálko
2019-10-06 18:13 ` Lonnie Abelbeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).