Wireguard Setup for more clients

Hello,
I don’t know how to continue. I am stuck for two days. I installed WireGuard based on documentation (https://doc.turris.cz/doc/en/public/wireguard): The first client worked immediately, but I cannot add more clients. WG runs, but the only first client is working. I configured it using uci interface. My /etc/config/network looks like

config interface 'wg0'
	option proto 'wireguard'
	option private_key 'privat server key'
	option listen_port '51820'
	list addresses '10.0.100.1/24'

config wireguard_wg0
    option description 'dMac'
    option public_key 'public client 1 key'
	option preshared_key 'preshared client 1 key'
	list allowed_ips '10.0.100.2/32'
    option route_allowed_ips '1'
	option persistent_keepalive '25'

config wireguard_wg1
    option description 'dPad'
	option public_key 'public client2 key
	option preshared_key 'preshared client2 key'
	list allowed_ips '10.0.100.3/32'
	option route_allowed_ips '1'
	option persistent_keepalive '25'

It is some stupid mistake probably, but I cannot find it. Can someone help me, please?

You need to add the client to the same interface (here wg0) and the IP list “list addresses” of “config interface ‘wg0’” no need to include the IP range of clients, only the range for your local network (and 0.0.0.0 (ipv4) if you want the router act as out point) is needed here.

Once you add the interface, Luci can help you to add clients easily vien its interface: /cgi-bin/luci/admin/network/network/wg0.

One thing that caused me problems with multiple clients when I first started using wireguard was that I had not understood that “each device should be a unique user”. So if you have five devices, you should set up five different users in the config.cfg file.

You need to specify each client under config wireguard_wg0 and not separately like config wireguard_wg0 and config wireguard_wg1

All the guides online are wrong so far, this is the correct way of doing it:

config wireguard_wg0
    option description 'dMac'
    ...

config wireguard_wg0
    option description 'dPad'
    ....

Remember to reboot the router afterwards. It should not be necessary, a restart of networking should be enough, but I’ve seen strange things (like openvpn no longer working, or lxc containers no longer being accessible) if you don’t reboot.

You seem to have missing closing ’ at wireguard_wg1 public_key line.

That shouldn’t matter here, they replaced the actual public key with “public client2 key” and while doing that deleted the closing apostrophe.