Wireguard config with "endpoint_host" not working with luci on 21.02.0-rc4

Hello!

Can't configure wireguard peers with option "endpoint" (client) on a ramips/mt7621 device on 21.02.0-rc4 with luci.

Error: Network device is not present

command line configuration works on all devices and releases.
configuration with luci works on all devices with 21.02.0-rc3.
configuration with luci works on non-dsa devices and all releases.

anyone else here with this error, or did I miss something...

As there is no answer I guess there is something wrong with my config.
It would be very helpful if someone with an mt7621 device could confirm that "wireguard-client" is working on 21.02.0-rc4.

to check:
append this to /etc/config/network:

config interface 'wg_test'
	option proto 'wireguard'
	list addresses '192.168.68.1/32'
	option private_key 'SP+tbIpPdi7ZjzivKPsVEo4zSTTlZoEaFCUe0R+jm3U='

config wireguard_wg_test
	option public_key 'l8SGbfG+oZIJrc8EQcDx0q7iAHDETF6RPgaYXOqZVVE='
	option endpoint_host '10.11.12.13'
	option endpoint_port '1234'

and see if an interface is created:

/etc/init.d/network restart
ifconfig wg_test

I'm no specialist, but here is my working rc4 config for comparison (this is to connect to a VPN provider):

config interface 'wg0'
	option proto 'wireguard'
	option listen_port '51820'
	option peerdns '0'
	option private_key 'my_private_key'
	list addresses '10.12.12.13/24'
	list dns '1.1.1.1'

config wireguard_wg0 'wgclient'
	option public_key 'my_public_key'
	option persistent_keepalive '25'
	option description 'WG'
	option endpoint_host '11.12.13.14'
	option endpoint_port '1443'
	list allowed_ips '0.0.0.0/0'

thank you for your config but unfortunately it does not work for me.
on which mt7621 device is this?

I've posted my config just for reference in case your problem was caused by misconfiguration, even though WireGuard package is not running on a MediaTek based device on my side. The posted config works for me on all versions of 21.02 made available this far, on both an x86/64 and a GL-MV1000 (mvebu based). Since it does not seem to work on your mt7621 based device, maybe on that platform something is amiss, either on the WG package itself, or on one of it's dependencies.

1 Like

Finally I got a second device for testing and found out that the problem occurs in a combination of option endpoint_host and lack of a option gateway in /etc/config/network.

Can someone please confirm that wireguard-interface creation failed if commenting-out option gateway on a mt7621-device with a wireguard-option endpoint_host.

Thank you in advance,

Robert

Sounds like you need to increase metric on the upstream interface.

I don't have a upstream interface on this device and the default route is advertised via ospf.
but even if i type in the default route by command line, the wireguard interface will not be created.

PS: I guess it's a bug because it is easy to reproduce:

install a fresh openwrt-rc4 with luci-proto-wireguard on mt7621
add a wireguard-peer with endpoint_host

-> no wireguard interfeace is created.

after adding a default route to /etc/config/network
the wireguard interface is created.