Development discussion of WireGuard
 help / color / mirror / Atom feed
* Bug restarting WireGuard using launchd on macOS
@ 2022-06-20 20:51 Alessio Nossa
  0 siblings, 0 replies; only message in thread
From: Alessio Nossa @ 2022-06-20 20:51 UTC (permalink / raw)
  To: WireGuard mailing list

Hello,
I am running WireGuard (installed with wireguard-tools, using
HomeBrew) on macOS 12.4, launched using launchd. All works fine until
I try to restart it, always with launchd.
When WireGuard interface is restarted, it looks like it crashes/gets
deactivated immediately: if I run 'wg show' nothing is displayed, but
on the "server" peer I can see that the "Latest handshake" report the
time elapsed since last "com.example.wg.restartWg.plist" execution.
The launchd configurations, that I saved at "/Library/LaunchDaemons/"
are available at
https://gist.github.com/alessionossa/78f69b9451a130240e2057acbd4eb7f8

The log at "/tmp/com.example.wg.restartWg.err" of is
    06/20/22 21:51:18
    [+] Interface for wg1 is utun0
    [#] rm -f /var/run/wireguard/utun0.sock
    [#] rm -f /var/run/wireguard/wg1.name
    --- Restarting... ---
    [#] wireguard-go utun
    [+] Interface for wg1 is utun0
    [#] wg setconf utun0 /dev/fd/63
    [#] ifconfig utun0 inet 10.181.0.5/32 10.181.0.5 alias
    [#] ifconfig utun0 up
    [#] route -q -n add -inet 10.181.0.3/32 -interface utun0
    [#] route -q -n add -inet 10.181.0.254/32 -interface utun0
    [#] route -q -n add -inet 10.181.0.11/32 -interface utun0
    [+] Backgrounding route monitor
    --- Restarted! ---
    06/20/22 21:56:20
    wg-quick: `wg1' is not a WireGuard interface
    --- Restarting... ---
    [#] wireguard-go utun
    [+] Interface for wg1 is utun0
    [#] wg setconf utun0 /dev/fd/63
    [#] ifconfig utun0 inet 10.181.0.5/32 10.181.0.5 alias
    [#] ifconfig utun0 up
    [#] route -q -n add -inet 10.181.0.3/32 -interface utun0
    [#] route -q -n add -inet 10.181.0.254/32 -interface utun0
    [#] route -q -n add -inet 10.181.0.11/32 -interface utun0
    [+] Backgrounding route monitor


If some more Information is needed to debug the issue, I am available.

Best regards,
Alessio Nossa

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-20 20:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20 20:51 Bug restarting WireGuard using launchd on macOS Alessio Nossa

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).