luci: OpenWRT 18.06 and wireguard: probably a bug

Hi, I noticed a strange behaviour of wireguard 0.0.20180718-2 with openWRT OpenWrt 18.06.1 r7258-5eb055306f.

opkg install wireguard kmod-wireguard luci-app-wireguard luci-proto-wireguard wireguard-tools
Package wireguard (0.0.20180718-2) installed in root is up to date.
Package kmod-wireguard (4.9.120+0.0.20180718-2) installed in root is up to date.
Package luci-app-wireguard (git-18.284.42397-55ebe88-1) installed in root is up to date.
Package luci-proto-wireguard (git-18.284.42397-55ebe88-1) installed in root is up to date.
Package wireguard-tools (0.0.20180718-2) installed in root is up to date.

The problem is that if I use only one peer, all works well. While if I add more peers the LUCI configuration under interface->wireguard interface name is different from the one of wireguard.

root@BTHomeHub:/# wg showconf wireguard
[Interface]
ListenPort = 51820
PrivateKey =

[Peer]
PublicKey = fEq76eJ+YYvOZMZB+5TVJ0T1mlRqdTKl1kWZsOQq111=
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = IP:3032
PersistentKeepalive = 25

[Peer]
PublicKey = SzmAUqFzWRHazql4EGVgphTdUBFq8Wus980nCl99111=
## missing line
Endpoint = IP:51820
PersistentKeepalive = 25

## missing peer

I did not find any file under/etc/configas usual.

wg
interface: wireguard
  public key: xhrX4aXDNUw2eCygHnXQYuaYpRKemY1HbshLATzI111=
  private key: (hidden)
  listening port: 51820

peer: fEq76eJ+YYvOZMZB+5TVJ0T1mlRqdTKl1kWZsOQq111=
  endpoint: IP:3032
  allowed ips: 0.0.0.0/0, ::/0
  transfer: 0 B received, 46.11 KiB sent
  persistent keepalive: every 25 seconds

peer: SzmAUqFzWRHazql4EGVgphTdUBFq8Wus980nCl99111=
  endpoint: IP:51820
  allowed ips: (none) ## missing
  transfer: 0 B received, 38.73 KiB sent
  persistent keepalive: every 25 seconds

## missing a peer

Best Regards

P.S. Also the field preshared key seems not work properly with more than one peer.

luci1 luci2

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 30 (11 by maintainers)

Most upvoted comments

@erotavlas85 How many of the AllowedIPs for your peers are set to “0.0.0.0/0, ::/0”? I had my three peers all set to: peer1 allowed ips “0.0.0.0/0” peer2 allowed ips “0.0.0.0/0” peer3 allowed ips “0.0.0.0/0”

and that was causing the issue for me. I changed them to the ip of the address of the client: peer1 allowed ips 10.0.2.2/32 peer2 allowed ips 10.0.2.3/32 peer3 allowed ips 10.0.2.4/32

and the problem was solved

@jow- I think we can close this.