Wireguard for Version 25

Just ran into another issue troubleshooting.
Wiregaurd Listen port never made it to /etc/config/network.
LuCI in v25 appears to have a bug where the port field doesn't persist correctly to the config file, so the interface came up with port 0 and no identity.
Easy workaround :
uci set network.WG.listen_port='PORT#'
uci commit network
service network restart

As another side note be careful with "service network restart" if you dont automatically reconnect, youll need to manually power cycle the router

I have tested on two different routers and cannot confirm your findings. I can set the listen port via LuCi without a problem

there are four releases in v25, which one are you referring to ?

Oops 25.12.2

I also tried 25.12.3 but an error with ubus Random seed bricked the system and had to reinstall

i set in Luci directly but in ssh and direct on router terminal the Port kept reverting. i used UCI commit and forced the update and it was fine after.

That could indicate that the main problem with your router and builds is somewhere else/deeper

hey egc,
i attempted this last night and bricked the router again. 25.12.3 in relation to ubus random seed failed. but this post is about Wireguard and i dont want to confuse the two.

It looks like Wireguard listen port through Luci will blank out if any peer is malformed leading to a GUI silent fail but i did find the error through log diving.

just to make sure none of this is criticism im just observing a behavior that stumped for about an hour and just trying to save other people time. i appreciate your interaction

I think that @egc 's point was that there is likely something else happening on your device that is causing multiple failures and other odd behaviors.

Malformed in what way? The GUI shouldn't fail silently, so that would be a bug, but then again, it does depend on the nature of the malformed peer config.

I fully understand but the behavior could indeed be triggered by other fields which are not filled correctly and then you first have to correct that before you can save that is how the GUI works it tries to prevent entering non valid information.
So the problem might not be WireGuard but just wrong information trying to be added to the GUI.
Garbage in > Garbage out :wink:

FYI:
WireGuard Client Setup Guide
WireGuard Server Setup Guide

Please correct the title: it's wireguard.
Goal is that this thread can be found using tag wireguard in future search.

ha! im thinking faster than my hands can type. ill update that now.

Sorry gents, i actually became frustrated fixing one thing only to find another wrong in 25.12.2 and 25.12.3.
i reverted back to 24.10.6 for stability.
i will make a secondary router in a bit for testing to help with the process.

the wireguard peer information seemed to fail in populating port and key; i eventually had to use Uci commits to force it. the closest i could come to an explanation is a possible failure of a malformed URL for one of the peers that was added after the wireguard keys where generated. it was unexpected behavior.

Please do. And provide a step-by-step process for reproducing the issue you're experiencing.

Thus far, nobody has been able to repro your issue. If there is a true bug, the process should be easily reproducible by others given that you seem to be able to get it to manifest pretty much every time you try. Also, based on your descriptions, that there could be 2 possible primary reasons you're having issues:

  • Validation bug -- LuCI should validate that any input is correctly formed (syntax only)
  • User error -- the system only checks for syntactic validity, but it cannot protect against logically incorrect values, so you may be doing something that is invalid but syntactically correct.

Malformed how?