[Feature Request] WireGuard server: Endpoint for each peers

Currently, gl-sdk4-wg-server doesn't allow to having endpoint for each peers, and gl-sdk4-wg-client doesn't allow multiple instances(actually those are two different instances though).

If each peers can have own endpoint value:

  • WireGuard "Server" can acts as both server and client(Actually WireGuard itself doesn't distinguish between the two by design)
  • WireGuard "Client"(menu item name) can be used for another purpose and cascading
  • Dependancy-less mesh configuration is possible(Requires simple additional settings for both routes and keys, but would be so much useful especially for lowend models like MT300N-V2 which doesn't capable to install and use other solutions like Tailscale)

This is a different issue but I found that many people requested many times for multiple instances, like this: WireGuard and GL-AXT1800 (Two WireGuard connections at the same time)

Having own endpoint for peers might be a simpler workaround when two or more "client" connection is needed(If a single interface address is allowed at multiple servers, it will be more efficient than using multiple instances, and at least it can be an alternative for two "client" instances).

Thanks, we're raising priority to support wireguard multi-instance.
Do you mean creating two wireguard servers, for example, one listening on 51820, the other listen on 51821? Could you elaborate the requirements and gain?

1 Like

That's a good news! Thank you for your feedback.

Anyway. What you said is "multiple interfaces", and what I said is literally "endpoint for each peers".

[Interface]
PrivateKey = ...
Address = 10.0.1.1/22
ListenPort = 51820

[Peer]
PublicKey = ...
AllowedIPs = 192.168.11.0/24, 10.0.0.0/22
Endpoint = xxa1a1a.glddns.com:51820
PersistentKeepalive = 25

[Peer]
PublicKey = ...
AllowedIPs = 192.168.22.0/24, 10.0.0.0/22
Endpoint = xxb2b2b.glddns.com:51820
PersistentKeepalive = 25

[Peer]
PublicKey = ...
AllowedIPs = 192.168.33.0/24, 10.0.0.0/22
Endpoint = xxc3c3c.glddns.com:51820
PersistentKeepalive = 25

[Peer]
PublicKey = ...
AllowedIPs = 192.168.44.0/24, 10.0.0.0/22
Endpoint = xxd4d4d.glddns.com:51820
PersistentKeepalive = 25

[Peer]
PublicKey = ...
AllowedIPs = 10.0.0.111/32
PersistentKeepalive = 25

[Peer]
PublicKey = ...
AllowedIPs = 10.0.0.222/32
PersistentKeepalive = 25

By configurations like this,

  • A single interface is act as a server and 4 clients at the same time.
  • Any of WG client devices are able to access every private network regardless of its endpoint(server).
  • More efficient and robust thanks to its "mesh" structure
2 Likes

This reminds me kinda on the kind of setup mullvad also shows on their blog on openwrt.

I like this idea :+1:, currently on openwrt with this setup it is not easy to have such peer talk on its own specific interface (the opposite what blog suggests, but still about the mesh part).

to accomplish you have to re-create the same interface with the same private key with the different peer in the section, so you can have wgclient1 (with a bunch of dutch peers), wgclient2(with a bunch of other country peers).

in openwrt itself that feels less inuititve for me, you really get the idea the more mesh approach looked like a last moment thought in luci atleast for me :yum:, when i first tried to use it that way i was worried that it would fail to work tbh due to the two instances with the same private key.

I hope this can also be expanded on from OP suggestion.

1 Like