TLDR: wireguard will not work correctly until the tunnel risen with wg-quick utility. Connman messes with routing tables, so part of traffic bypass wg adapter.
CoreElec(I’ve used image: Amlogic-ng.arm-21.1-Omega_nightly_20240820) includes cutted version of wireguard that doesn’t include wg-quick script. Instead of that usage of connman is proposed. I didn’t satisfied with connman result(config was done by this guide, which rises tunnel up, but when I run:
curl ifconfig.co
It show be different ip from time to time - sometimes ip of my provider, sometimes - of my wireguard server. It is very dangerous in terms of privacy if you watch content for some reason regulated or blocked in your country!
So I’ve tried to copy wg-quick utility(it is just regular bash script with no deps) from regular Debain linux to my CoreElec installation, to /storage/wireguard dir. But replaced there “/etc/wireguard” with “/storage/wirguard” where my profile stored, so script can run profile.
After that I’ve tried to run:
CoreELEC:~/wireguard # bash wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip link set mtu 1420 up dev wg0
[#] wg set wg0 fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
ip: invalid argument '51820' to 'table'
[#] ip link delete dev wg0
The same profile wg0.conf sucessfuly runs with same command on Debian and Ubuntu. So I assume it is some CoreElec specific problem, maybe routing tables, maybe kernel configuration, maybe wireguard version.
Now wireguard completely broken and irreliable. The connman solution just masks the problem. Please make sure wireguard correctly works with wg-quick first. Connman can be pretty glitchy by itself, even when managing regular network adapters, not even talking about virtual ones.