Get list of peers without using Central API on the client

I’m making a simpler GUI for zerotier, for those migrating from another popular solution (mainly making it for me and my friends ATM, but will open-source once ready), but I’m hitting kind of a snag. In the competing app, you could see a list of devices.
This is also possible in zerotier, but only by the network admins, which is not ideal.

I’d like to get a list of the other members of the network on the client side. I’ve tried various “LAN scanning” things, like ip neighbour, arp -a, nmap -sP 172.26.0.0/16, but none have worked. Trying to use ping/nmap balloons the memory usage of the zerotier-one service to above 500MB, so I don’t think that is something I should do.
I’ve tried to look at the zerotier protocol docs, but it flies over my head.

As far as my experiments go, I think zerotier does not give its peers a list of other peers for routing, unless you try to ping the IP address of one of those peers first (which means you have to know their IP beforehand)

The /peers api was almost useful, but it is network-agnostic and does not show in-network IPs, only their external IP, which is not useful. And this also probably doesn’t populate until you try to connect.

One “solution” I’ve thought of is reducing the subnet to a /24, but I’d like the member list to work on subnets of all sizes.

Any ideas? The central API also does not let you make read-only API tokens, so that’s also not quite what I want (and it’d also complicate things quite a lot UX-wise)

If you just care about hostnames, you could run LLDP on the hosts. This wouldn’t have any zerotier specific information. It would also cause all peers within a network to have an active session to all other peers in the network at all times. Lastly, it wouldn’t work on mobile devices or any other device that couldn’t run LLDP.

Perhaps a better way is to have the backend of the GUI retrieve the information from the central API. This would prevent all of the individual clients from being able to access the Centrail API. You can separate that even further and have a separate process return the JSON from the API, and then have the backend use that JSON data to show your peers.

This topic was automatically closed after 30 days. New replies are no longer allowed.