Unetd not working behind NATs

I have two OpenWrt Routers both running latest 24.10.5 and connected to internet via separate cellular modems.
I also have a Violet STUN running on the clouds and reachable from both OpenWrt routers.

I initiated my Unetwork using following commands :

root@OpenWrt:~# unet-cli test.json create stun=X.Y.Y.Z:3478 
root@OpenWrt:~# unet-cli test.json add-ssh-host charlie root@192.168.4.1 subnet=192.168.4.0/24 groups=nodes dht=1 
root@OpenWrt:~# unet-cli test.json add-ssh-host ida root@192.168.5.1 subnet=192.168.5.0/24 groups=nodes dht=1
root@OpenWrt:~# cat test.json
{
        "config": {
                "port": 51830,
                "keepalive": 10,
                "peer-exchange-port": 51831,
                "stun-servers": [
                        "X.Y.Y.Z:3478"
                ],
                "id": "zFZW1iEchxPwChs------tQWifWPiS-------olvEGSM="
        },
        "hosts": {
                "charlie": {
                        "key": "GYmBkCNzcnr------Wj1gNKjX------EW2pnbXS8=",
                        "subnet": [
                                "192.168.4.0/24"
                        ],
                        "groups": [
                                "nodes"
                        ]
                },
                "ida": {
                        "key": "qi---------------------LgU=",
                        "subnet": [
                                "192.168.5.0/24"
                        ],
                        "groups": [
                                "nodes"
                        ]
                }
        },
        "services": {
        }
}
root@OpenWrt:~# unet-cli test.json sign upload=192.168.4.1
Uploading test.json.bin to 192.168.4.1
root@OpenWrt:~# unet-cli test.json sign upload=192.168.5.1
Uploading test.json.bin to 192.168.5.1
root@OpenWrt:~# 

as soon as I sign and upload I see on my STUN server log :


2026-01-01 12:04:54 INFO    Got STUN binding from client X.Z.16.40:5928
2026-01-01 12:05:35 INFO    Got STUN binding from client X.Y.41.146:26951

I noticed the lack of endpoint in my wg show so i thought this could be a problem as I haven’t set anything on the account of not having any consistent ip (except for the stun server) in my setup:

root@Charlie:~# wg show
interface: unet
public key: GYmBkCNzcnrUkd21O3P+DWj1gNKjXqS8teEW2pnbXS8=
private key: (hidden)
listening port: 51830

peer: qi03WYteQiLMYdjiFJ3dSExXgI1EZzmWYT3zwU2nLgU=
allowed ips: fdf3:cbda:4e19:8b2:a8d5:c8a0:a7cd:8c29/128, 192.168.5.0/24
root@Charlie:~#

so I enabled dhcp server on both my modems and made sure they are on different subnets. which lead to making a whole set of new unetwork :

root@OpenWrt:~# unet-cli test.json create stun=X.Y.Y.Z:3478 
root@OpenWrt:~# unet-cli test.json add-service l2-tunnel type=vxlan members=@nodes
root@OpenWrt:~# unet-cli test.json add-ssh-host charlie root@192.168.4.1 endpoint=192.168.254.20 groups=nodes dht=1
root@OpenWrt:~# unet-cli test.json add-ssh-host ida root@192.168.5.1 endpoint=192.168.25.25 groups=nodes dht=1
root@OpenWrt:~# unet-cli test.json sign upload=192.168.5.1
Uploading test.json.bin to 192.168.5.1
root@OpenWrt:~# unet-cli test.json sign upload=192.168.4.1
Uploading test.json.bin to 192.168.4.1
root@OpenWrt:~# cat test.json
{
"config": {
"port": 51830,
"keepalive": 10,
"peer-exchange-port": 51831,
"stun-servers": [
"X.Y.Y.Z:3478"
],
"id": "2+R83wB7-------------z852fjQ="
},
"hosts": {
"charlie": {
"key": "PoDRtl9c7---------------Fe8iTU=",
"endpoint": "192.168.254.20",
"groups": [
"nodes"
]
},
"ida": {
"key": "ILAugj-----------------oOS2JGI=",
"endpoint": "192.168.25.25",
"groups": [
"nodes"
]
}
},
"services": {
"l2-tunnel": {
"config": {
},
"members": [
"@nodes"
],
"type": "vxlan"
}
}
}
root@OpenWrt:~#


however I’m unable to figure out how to connect these two routers behind NATted cellular modems :



root@Charlie:~# wg show
interface: unet
public key: PoDRtl9c7q---------e8iTU=
private key: (hidden)
listening port: 51830

peer: ILAugj6Znm--------qoOS2JGI=
endpoint: 192.168.25.25:51830
allowed ips: fd1b:4480:4d67:95e0:f829:603e:6ab4:9369/128
transfer: 0 B received, 3.90 KiB sent
persistent keepalive: every 10 seconds
root@Charlie:~# ping6 fd1b:4480:4d67:95e0:f829:603e:6ab4:9369
PING fd1b:4480:4d67:95e0:f829:603e:6ab4:9369 (fd1b:4480:4d67:95e0:f829:603e:6ab4:9369): 56 data bytes
^C
--- fd1b:4480:4d67:95e0:f829:603e:6ab4:9369 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss
root@Charlie:~#