From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: uberscubajim@gmail.com Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 2e2aa285 for ; Sun, 10 Sep 2017 22:57:46 +0000 (UTC) Received: from mail-wr0-f182.google.com (mail-wr0-f182.google.com [209.85.128.182]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id fd140790 for ; Sun, 10 Sep 2017 22:57:46 +0000 (UTC) Received: by mail-wr0-f182.google.com with SMTP id k20so11429359wre.4 for ; Sun, 10 Sep 2017 16:23:48 -0700 (PDT) Return-Path: Message-ID: <59B5C95F.50508@gmail.com> Date: Mon, 11 Sep 2017 00:23:11 +0100 From: Jim Darby MIME-Version: 1.0 To: "Jason A. Donenfeld" Subject: Re: Timing issue (?) with wg-quick up on Raspberry Pi B+ References: <1e1740c3-f8cf-2ee2-d842-749b687cb737@gmail.com> <07621915-a53a-03f3-9c75-b7e7d188d109@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------080505040809050809020201" Cc: WireGuard mailing list List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This is a multi-part message in MIME format. --------------080505040809050809020201 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10/09/17 23:25, Jason A. Donenfeld wrote: > I just wrote the attached script, which will tell you all the > processes that have an open netlink socket... > > There's a bit too much fluff in there on a desktop system, but I > imagine the pi might help boil it down to a few candidates. Probably > we'll determine it's an ifplugd/ifupdown.action thing, but we'll see. Many thanks again for such great work. Here's the output of the netlistenerwho.sh program. It's awash with potential culprits! PID TTY STAT TIME COMMAND 1 ? Ss 2:35 /sbin/init 128 ? Ss 0:01 /lib/systemd/systemd-udevd 770 ? Ss 2:24 /sbin/dhcpcd -q -b 783 ? Ss 0:15 avahi-daemon: running [janus.local] 840 ? Ss 0:32 /lib/systemd/systemd-logind 896 ? Ss 10:19 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 107:112 906 ? S 0:02 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq. 1204 ? Ss 0:00 /lib/systemd/systemd --user 18942 ? Ss 0:00 /lib/systemd/systemd --user I also made a great mistake earlier: the problematic system is the version of Raspbian based on begin *8* and /not/ *9*. Debian 9 works fine! I've tweaked the /etc/network/interfaces file to have the line “iface wg0 inet manual” in it so we /shouldn't/ get DHCP running or anything… I tried the nlmon trick but I got the response “RTNETLINK answers: Operation not supported” which isn't too helpful. After some more playing I've found that running the wg-quick script's commands by hand works. But then, I'm /manually/ entering them and that affects timing. I note you perform the ”ip link set wg0 up” /after/ the “ip address add 192.168.2.3/32 dev wg0” and “ip link set mtu 1420 dev wg0”. /However, /the act of creating the interface with the “ip link add wg0 type wireguard” seems to trigger the ip up automatically. The log files give: Sep 10 23:57:51 janus kernel: wireguard: WireGuard 0.0.20170907 loaded. See www.wireguard.com for information. Sep 10 23:57:51 janus kernel: wireguard: Copyright (C) 2015-2017 Jason A. Donenfeld . All Rights Reserved. Sep 10 23:57:51 janus ifplugd(wg0)[14109]: ifplugd 0.28 initializing. Sep 10 23:57:51 janus ifplugd(wg0)[14109]: Using interface wg0/00:00:00:00:00:00 Sep 10 23:57:51 janus ifplugd(wg0)[14109]: Using detection mode: IFF_RUNNING Sep 10 23:57:51 janus ifplugd(wg0)[14109]: Initialization complete, link beat detected. Sep 10 23:57:52 janus ifplugd(wg0)[14109]: Executing '/etc/ifplugd/ifplugd.action wg0 up'. Sep 10 23:57:52 janus ifplugd(wg0)[14109]: client: /sbin/ifup: interface wg0 already configured Sep 10 23:57:52 janus ifplugd(wg0)[14109]: Program executed successfully. Which could well be interesting. I manually ran ifdown then ifup on wg0 and it /didn't/ lose its IP address. Most perplexing! Jim. --------------080505040809050809020201 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 10/09/17 23:25, Jason A. Donenfeld wrote:
I just wrote the attached script, which will tell you all the
processes that have an open netlink socket...

There's a bit too much fluff in there on a desktop system, but I
imagine the pi might help boil it down to a few candidates. Probably
we'll determine it's an ifplugd/ifupdown.action thing, but we'll see.

Many thanks again for such great work. Here's the output of the netlistenerwho.sh program. It's awash with potential culprits!

  PID TTY      STAT   TIME COMMAND
    1 ?        Ss     2:35 /sbin/init
  128 ?        Ss     0:01 /lib/systemd/systemd-udevd
  770 ?        Ss     2:24 /sbin/dhcpcd -q -b
  783 ?        Ss     0:15 avahi-daemon: running [janus.local]
  840 ?        Ss     0:32 /lib/systemd/systemd-logind
  896 ?        Ss    10:19 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 107:112
  906 ?        S      0:02 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.
 1204 ?        Ss     0:00 /lib/systemd/systemd --user
18942 ?        Ss     0:00 /lib/systemd/systemd --user

I also made a great mistake earlier: the problematic system is the version of Raspbian based on begin 8 and not 9. Debian 9 works fine!

I've tweaked the /etc/network/interfaces file to have the line “iface wg0 inet manual” in it so we shouldn't get DHCP running or anything…

I tried the nlmon trick but I got the response “RTNETLINK answers: Operation not supported” which isn't too helpful.

After some more playing I've found that running the wg-quick script's commands by hand works. But then, I'm manually entering them and that affects timing.

I note you perform the ”ip link set wg0 up” after the “ip address add 192.168.2.3/32 dev wg0” and “ip link set mtu 1420 dev wg0”. However, the act of creating the interface with the “ip link add wg0 type wireguard” seems to trigger the ip up automatically. The log files give:

Sep 10 23:57:51 janus kernel: wireguard: WireGuard 0.0.20170907 loaded. See www.wireguard.com for information.
Sep 10 23:57:51 janus kernel: wireguard: Copyright (C) 2015-2017 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
Sep 10 23:57:51 janus ifplugd(wg0)[14109]: ifplugd 0.28 initializing.
Sep 10 23:57:51 janus ifplugd(wg0)[14109]: Using interface wg0/00:00:00:00:00:00
Sep 10 23:57:51 janus ifplugd(wg0)[14109]: Using detection mode: IFF_RUNNING
Sep 10 23:57:51 janus ifplugd(wg0)[14109]: Initialization complete, link beat detected.
Sep 10 23:57:52 janus ifplugd(wg0)[14109]: Executing '/etc/ifplugd/ifplugd.action wg0 up'.
Sep 10 23:57:52 janus ifplugd(wg0)[14109]: client: /sbin/ifup: interface wg0 already configured
Sep 10 23:57:52 janus ifplugd(wg0)[14109]: Program executed successfully.

Which could well be interesting. I manually ran ifdown then ifup on wg0 and it didn't lose its IP address.

Most perplexing!

Jim.
--------------080505040809050809020201--