mwarning / zerotier-openwrt

A OpenWrt package for ZeroTier One - Pull requests are welcome!
697 stars 146 forks source link

Generating new ZT client id each time rebooting router #22

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, I followed the KB article and each time I reboot I get a new network id, so each time I need to authorize it. The filesystem on the router seems to be writable, because the /etc/config/zerotier was modified and saved. Is there something else I can look at? Thanks.

My Setup: LEDE/Openwrt: LEDE Reboot SNAPSHOT r5465-98fb380 / LuCI Master (git-17.341.69632-b7906fc) firmware: brcm47xx-mips74k-linksys-e2000-v1-squashfs.bin ZeroTier One version 1.2.4 build 0 (platform 1 arch 5) Router is behind modem/router

/etc/config/zerotier

config zerotier 'default'
    option enabled '1'
    option interface 'wan'
    list join 'my network address'
    option secret 'long string'

interface zt0, allow unmanaged interface lan general setup: 10.99.5.1 255.255.254.0 / physical: zt0 enabled/checked

mwarning commented 6 years ago

After reboot. The client id stays the same for me. It is the first part of the secret, e.g. option secret '0dfbb75d8a:0:6b3bc227229bcf0b1b15...' - here, 0dfbb75d8a is the client id.

ghost commented 6 years ago

sorry i have also mentioned this issue at https://github.com/zerotier/ZeroTierOne/issues/643 and there i mentioned that /var/lib/Zerotier-one is mounted at /tmp and not saved persistently across reboots.

Yesterday I have installed a different router with LEDE snapshot/Zerotier1.2.4 and this one does not seem to have this problem. Its maybe only related to the LEDE snapshot of the E2000. I will post this issue on LEDE github.

mwarning commented 6 years ago

I do not know what the problem is on a E2000. Please check if the /var/lib/zerotier-one/identity.secret has the content of option secret in /etc/config/zerotier.

ghost commented 6 years ago

@mwarning sorry, as you already had pointed out, that it has something with option secret in /etc/config/zerotier i should not have modified this hex string, this has led to the consistent regeneration of new zt address with each reboot.

i found out when i reset the modem to default settings and reinstalled zerotier, but this time i didnt modify the hex string.

mwarning commented 6 years ago

ok, good you found the problem.