From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: mail@53c70r.de Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id a6173a27 for ; Thu, 28 Jun 2018 12:26:35 +0000 (UTC) Received: from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 46c2c3ca for ; Thu, 28 Jun 2018 12:26:34 +0000 (UTC) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 8DFF140F67 for ; Thu, 28 Jun 2018 14:32:21 +0200 (CEST) Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id TSFy9nVgxg-9 for ; Thu, 28 Jun 2018 14:32:18 +0200 (CEST) Subject: Fwd: Re: wg-quick broken by iproute2 update References: To: wireguard@lists.zx2c4.com From: Silvan Nagl Message-ID: <10808a9e-d503-245e-546c-d3ca77d2a1b0@53c70r.de> Date: Thu, 28 Jun 2018 14:32:06 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------7DAC19D2D13F2D7DBE18A088" 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. --------------7DAC19D2D13F2D7DBE18A088 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit -------- Forwarded Message -------- Subject: Re: wg-quick broken by iproute2 update Date: Thu, 28 Jun 2018 11:53:59 +0200 From: Silvan Nagl To: stunnel@attglobal.net Hi, since i had to debug this problem already i can tell you it is not iproute2 causing the problem. The main problem is that the current standard kernel of CentOS simple does not support the handling of "suppress_prefixlength". Iproute2 supports it since it does not return any error while adding so it had to be the kernel causing problems. In essence Red Hats official answer was "It isn't a bug, RHEL7 simple does not support it". If you sill want to fix your problem just upgrade your kernel to long-term or mainline. Regards, Silvan On 06/28/2018 04:47 AM, Eddie wrote: > Hi, > > I just updated both a RHEL and a CentOS system from 7 -> 7.5. > Following this, when running wg-quick, the routing tables are not > updated correctly.  Both systems are running > iproute.x86_64-4.11.0-14.el7, but from different repositories and are > definitely different builds as they install to different sbin libraries. > > Here's what I'm seeing: > > [eddieath@oc8361880017 ~]$ sudo ip rule list > 0:    from all lookup local > 32766:    from all lookup main > 32767:    from all lookup default > [eddieath@oc8361880017 ~]$ > [eddieath@oc8361880017 ~]$ sudo wg-quick up wg0 > [#] ip link add wg0 type wireguard > [#] wg setconf wg0 /dev/fd/63 > [#] ip address add 192.168.0.11/24 dev wg0 > [#] ip link set mtu 1420 dev wg0 > [#] ip link set wg0 up > [#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820 > [#] ip -4 rule add not fwmark 51820 table 51820 > [#] ip -4 rule add table main suppress_prefixlength 0 > [eddieath@oc8361880017 ~]$ > [eddieath@oc8361880017 ~]$ sudo ip rule list > 0:    from all lookup local > 32764:    from all lookup main > 32765:    not from all fwmark 0xca6c lookup 51820 > 32766:    from all lookup main > 32767:    from all lookup default > [eddieath@oc8361880017 ~]$ > > Note the "suppress_prefixlength 0" has been dropped, which really > breaks the routing with a "normal" main ahead of table 51820. > Following this, when running the "down", the duplicated table is not > removed, as there is no match searching for "suppress_prefixlength 0": > > [eddieath@oc8361880017 ~]$ sudo wg-quick down wg0 > [#] wg showconf wg0 > sync: ignoring all arguments > [#] ip -4 rule delete table 51820 > [#] ip link delete dev wg0 > [eddieath@oc8361880017 ~]$ sudo ip rule list > 0:    from all lookup local > 32764:    from all lookup main > 32766:    from all lookup main > 32767:    from all lookup default > [eddieath@oc8361880017 ~]$ > > I've confirmed this on both systems and also that the behaviour is > purely within ip, and not anything that wg-quick is doing: > > [eddieath@oc8361880017 ~]$ sudo ip rule list > 0:    from all lookup local > 32766:    from all lookup main > 32767:    from all lookup default > [eddieath@oc8361880017 ~]$ sudo ip -4 rule add table main > suppress_prefixlength 0 > [eddieath@oc8361880017 ~]$ sudo ip rule list > 0:    from all lookup local > 32765:    from all lookup main > 32766:    from all lookup main > 32767:    from all lookup default > [eddieath@oc8361880017 ~]$ > > Cheers. > > _______________________________________________ > WireGuard mailing list > WireGuard@lists.zx2c4.com > https://lists.zx2c4.com/mailman/listinfo/wireguard --------------7DAC19D2D13F2D7DBE18A088 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit




-------- Forwarded Message --------
Subject: Re: wg-quick broken by iproute2 update
Date: Thu, 28 Jun 2018 11:53:59 +0200
From: Silvan Nagl <mail@53c70r.de>
To: stunnel@attglobal.net


Hi,

since i had to debug this problem already i can tell you it is not 
iproute2 causing the problem.
The main problem is that the current standard kernel of CentOS simple 
does not support the handling of "suppress_prefixlength".
Iproute2 supports it since it does not return any error while adding so 
it had to be the kernel causing problems.
In essence Red Hats official answer was "It isn't a bug, RHEL7 simple 
does not support it".
If you sill want to fix your problem just upgrade your kernel to 
long-term or mainline.

Regards,
Silvan

On 06/28/2018 04:47 AM, Eddie wrote:
> Hi,
>
> I just updated both a RHEL and a CentOS system from 7 -> 7.5. 
> Following this, when running wg-quick, the routing tables are not 
> updated correctly.  Both systems are running 
> iproute.x86_64-4.11.0-14.el7, but from different repositories and are 
> definitely different builds as they install to different sbin libraries.
>
> Here's what I'm seeing:
>
> [eddieath@oc8361880017 ~]$ sudo ip rule list
> 0:    from all lookup local
> 32766:    from all lookup main
> 32767:    from all lookup default
> [eddieath@oc8361880017 ~]$
> [eddieath@oc8361880017 ~]$ sudo wg-quick up wg0
> [#] ip link add wg0 type wireguard
> [#] wg setconf wg0 /dev/fd/63
> [#] ip address add 192.168.0.11/24 dev wg0
> [#] ip link set mtu 1420 dev wg0
> [#] ip link set wg0 up
> [#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
> [#] ip -4 rule add not fwmark 51820 table 51820
> [#] ip -4 rule add table main suppress_prefixlength 0
> [eddieath@oc8361880017 ~]$
> [eddieath@oc8361880017 ~]$ sudo ip rule list
> 0:    from all lookup local
> 32764:    from all lookup main
> 32765:    not from all fwmark 0xca6c lookup 51820
> 32766:    from all lookup main
> 32767:    from all lookup default
> [eddieath@oc8361880017 ~]$
>
> Note the "suppress_prefixlength 0" has been dropped, which really 
> breaks the routing with a "normal" main ahead of table 51820. 
> Following this, when running the "down", the duplicated table is not 
> removed, as there is no match searching for "suppress_prefixlength 0":
>
> [eddieath@oc8361880017 ~]$ sudo wg-quick down wg0
> [#] wg showconf wg0
> sync: ignoring all arguments
> [#] ip -4 rule delete table 51820
> [#] ip link delete dev wg0
> [eddieath@oc8361880017 ~]$ sudo ip rule list
> 0:    from all lookup local
> 32764:    from all lookup main
> 32766:    from all lookup main
> 32767:    from all lookup default
> [eddieath@oc8361880017 ~]$
>
> I've confirmed this on both systems and also that the behaviour is 
> purely within ip, and not anything that wg-quick is doing:
>
> [eddieath@oc8361880017 ~]$ sudo ip rule list
> 0:    from all lookup local
> 32766:    from all lookup main
> 32767:    from all lookup default
> [eddieath@oc8361880017 ~]$ sudo ip -4 rule add table main 
> suppress_prefixlength 0
> [eddieath@oc8361880017 ~]$ sudo ip rule list
> 0:    from all lookup local
> 32765:    from all lookup main
> 32766:    from all lookup main
> 32767:    from all lookup default
> [eddieath@oc8361880017 ~]$
>
> Cheers.
>
> _______________________________________________
> WireGuard mailing list
> WireGuard@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/wireguard

--------------7DAC19D2D13F2D7DBE18A088--