WireGuard Archive on lore.kernel.org
 help / color / Atom feed
From: "Adrián Mihálko" <adriankoooo@gmail.com>
To: wireguard@lists.zx2c4.com
Subject: wg-quick systemd service doesn't work after boot
Date: Sun, 6 Oct 2019 18:54:47 +0200
Message-ID: <CA+Hw3ebFCOoc6N_sn9HsaGmLiFp68XY+jLV83NS5JqmtLZ=8-g@mail.gmail.com> (raw)

[-- 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 --]

<div dir="ltr"><div dir="ltr"><div dir="ltr">I have 3 wg interface on my server, but I am unable to enable wg0 with wg-quick at boot:<br><br>@ubuntu:~$ sudo systemctl enable wg-quick@wg0<br>@ubuntu:~$ <div><br></div><div><div>Oct 06 13:22:51 ubuntu systemd[1]: Starting WireGuard via wg-quick(8) for wg0...</div><div>Oct 06 13:22:51 ubuntu wg-quick[1737]: Warning: `/etc/wireguard/wg0.conf&#39; is world accessible</div><div>Oct 06 13:22:52 ubuntu wg-quick[1737]: [#] ip link add wg0 type wireguard</div><div>Oct 06 13:22:52 ubuntu wg-quick[1737]: [#] wg setconf wg0 /dev/fd/63</div><div>Oct 06 13:22:52 ubuntu wg-quick[1737]: [#] ip -4 address add <a href="http://192.168.5.2/24">192.168.5.2/24</a> dev wg0</div><div>Oct 06 13:22:52 ubuntu wg-quick[1737]: [#] ip link set mtu 1420 up dev wg0</div><div>Oct 06 13:22:53 ubuntu wg-quick[1737]: [#] ip -4 route add <a href="http://192.168.2.0/24">192.168.2.0/24</a> dev wg0</div><div>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</div><div><b>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?</b></div><div>Oct 06 13:22:53 ubuntu wg-quick[1737]: [#] ip link delete dev wg0</div><div>Oct 06 13:22:53 ubuntu systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=1/FAILURE</div><div>Oct 06 13:22:53 ubuntu systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.</div><div>Oct 06 13:22:53 ubuntu systemd[1]: wg-quick@wg0.service: Unit entered failed state.</div><div>Oct 06 13:22:53 ubuntu systemd[1]: wg-quick@wg0.service: Failed with result &#39;exit-code&#39;.</div></div><div><br></div><div>As you can see it fails at iptables command.</div><div><br></div><div>wg0, wg2 fails with this problem, but wg1 starts without problem (same config, with iptables command).</div><div><br></div><div><br></div></div></div></div>

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

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

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-06 16:54 Adrián Mihálko [this message]
2019-10-06 18:13 ` Lonnie Abelbeck

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+Hw3ebFCOoc6N_sn9HsaGmLiFp68XY+jLV83NS5JqmtLZ=8-g@mail.gmail.com' \
    --to=adriankoooo@gmail.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

WireGuard Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ https://lore.kernel.org/wireguard \
		wireguard@lists.zx2c4.com
	public-inbox-index wireguard

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/com.zx2c4.lists.wireguard


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git