Hi,
I got my first two wg peers to connect. But as I added the third peer, it won't get picked from gui to system configs. OPNsense is the latest version at the date, OPNsense 22.1.10-amd64. The config is just the same as the two previous ones, listing name, public key and allowed ip (192.168.116.22/24).
But when I apply the settings, only the two first ones are written into wg0 config file, also seen from gui in peer list. The third one never gets there. See Peer List view:
interface: wg1
public key: (hidden)
private key: (hidden)
listening port: 55555
peer: (hidden)
endpoint: 1.1.11.24:24472
allowed ips: 192.168.116.21/32
latest handshake: 10 minutes, 34 seconds ago
transfer: 4.89 MiB received, 1.00 GiB sent
peer: (hidden)
endpoint: 1.1.1.24:26682
allowed ips: 192.168.116.20/32
latest handshake: 36 minutes, 6 seconds ago
transfer: 340.61 KiB received, 480.98 KiB sent
How can this be? I have tried saving and applying it several times, but the third one never get's there. Also restarted the wg several times. The config of peer is just like the others, only pubkey and ip are different. What am I missing?
See attached client list screenshot.
Problem solved after several hours of wondering. And of course, it was a user problem again (me!). I found this issue, where someone had the same problem and he reminded it's not enough to save peers and apply, but they need to be listed in server peers list separately.
I know it's my bad, but it is easy to miss. It might be worth adding a remindender text in the dialog where one creates new peers. Or better yet, ask there to which servers you want to assign the peer to, having the list there too. As such it's super easy to miss.
https://github.com/opnsense/plugins/issues/2926