WireGuard Archive on lore.kernel.org
 help / color / Atom feed
* wg-quick broken by iproute2 update
@ 2018-06-28  2:47 Eddie
  0 siblings, 0 replies; only message in thread
From: Eddie @ 2018-06-28  2:47 UTC (permalink / raw)
  To: WireGuard mailing list

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.

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

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-28  2:47 wg-quick broken by iproute2 update Eddie

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 zx2c4-wireguard@archiver.kernel.org
	public-inbox-index wireguard


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