mwarning / zerotier-openwrt

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

0 join connection failed #23

Closed Seohol closed 6 years ago

Seohol commented 6 years ago

Hello guys, I've tried to install zerotier package to my router TP-Link 4300 v1 LEDE version: LEDE Reboot 17.01-SNAPSHOT r3600-d77fe92 / LuCI lede-17.01 branch ( Trunk ) Kernel Version | 4.4.102 Package installed: zerotier_1.2.4-2_mips_24kc.ipk

My steps: root@TPLINK4300:~# opkg update

scp ./Downloads/zerotier_1.2.4-2_mips_24kc.ipk root@192.168.1.1:/tmp

root@TPLINK4300:~# cd /tmp

root@TPLINK4300:/tmp# opkg install /tmp/zerotier_1.2.4-2_mips_24kc.ipk

Installing zerotier (1.2.4-2) to root...
Installing libstdcpp (5.4.0-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.4/targets/ar71xx/generic/packages/libstdcpp_5.4.0-1_mips_24kc.ipk
Installing libminiupnpc (1.9-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.4/packages/mips_24kc/packages/libminiupnpc_1.9-1_mips_24kc.ipk
Installing libnatpmp (20140401-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.4/packages/mips_24kc/packages/libnatpmp_20140401-1_mips_24kc.ipk
Configuring libstdcpp.
Configuring libminiupnpc.
Configuring libnatpmp.
Configuring zerotier.
Generate secret - please wait...

root@TPLINK4300:/tmp# root@TPLINK4300:/tmp# /etc/init.d/zerotier start root@TPLINK4300:/tmp# zerotier-cli join xxxxx 0 join connection failed root@TPLINK4300:/tmp#

root@TPLINK4300:/tmp# /etc/init.d/firewall stop

Warning: Unable to locate ipset utility, disabling ipset support
 * Flushing IPv4 filter table
 * Flushing IPv4 nat table
 * Flushing IPv4 mangle table
 * Flushing IPv6 filter table
 * Flushing IPv6 mangle table
 * Flushing conntrack table ...
Command failed: Not found

root@TPLINK4300:/tmp# /etc/init.d/zerotier restart root@TPLINK4300:/tmp# zerotier-cli join xxxxx 0 join connection failed

root@TPLINK4300:~# ps|grep zerotier 2120 root 1420 S grep zerotier

if I missed something? or my device isn't supported?

mwarning commented 6 years ago

Maybe it has to do that there is a network configured by default (the Earth network) in /etc/config/zerotier. I don't use ZT myself, so I am not sure if this is a problem.

Do you happen to know if it has worked before?

Seohol commented 6 years ago

I've reinstalled latest LEDE and install "latest" 1.1.14 package from openwrt repo. Works well.

mwarning commented 6 years ago

@adamierymenko: do you have an idea?

mwarning commented 6 years ago

Please try images from https://downloads.lede-project.org/snapshots/targets/ - maybe the issue has been resolved.

boschkundendienst commented 6 years ago

You have to setup the networks ZeroTier should connect to via /etc/config/zerotier or using the uci command line interface.

After a clean install of ZeroTier /etc/config/zerotier looks like this:

config zerotier 'sample_config'
        option interface 'wan'
        list join '8056c2e21c000001'
        option enabled '1'
        option secret 'generate'

The init script /etc/init.d/zerotier detects that the secret is generate and will create one and add it into /etc/config/zerotier like this:

config zerotier 'sample_config'
        option interface 'wan'
        list join '<single or multiple network ids you want to connect to>'
        option enabled '1'
        option secret '<some very long cryptic stuff>'

After that Zerotier will join you to the global network (8056c2e21c000001)where everyone can connect to everybody (not good).

So you should change the ZeroTier config in /etc/config/zerotier manually by editing the file or via uci command line and replace 8056c2e21c000001 with your network ID , then restart zerotier or reboot your router. The ZeroTier client connects to all networks that are in the list join.

For multiple networks (3 in the example below) just expand the list like this:

config zerotier 'sample_config'
        option interface 'wan'
        list join '<your first network>'
        list join '<your second network>'
        list join '<your third network>'
        option enabled '1'
        option secret '<some very long cryptic stuff>'
mwarning commented 6 years ago

I don't know what can be done here. Maybe it's a usage error, a bug or a network error. I don't think we can find out since it works for me.

Please reopen if the problem persists.