zerotier / ZeroTierOne

A Smart Ethernet Switch for Earth
https://zerotier.com
Other
14.32k stars 1.67k forks source link

List networks that I've left (linux CLI) #1226

Open bartmichu opened 4 years ago

bartmichu commented 4 years ago

Is your feature request related to a problem? Please describe. On Linux command line I find it virtually impossible to join/leave on demand when dealing with multiple networks.

I'm dealing with multiple clients (companies) via my workstation. Each client has a separate network. My workstation is authorized in all networks, but it shouldn't be connected with them 24/7. I want to join the specific network only when requested.

Describe the solution you'd like Ability to list networks that I have left together with their name (as seen the last time when connected).

Describe alternatives you've considered Use human readable, meaningful interface names and bring them down/up instead of leaving/joining networks. Don't know how to do this.

Additional context In mobile app it works perfectly fine as all networks, including inactive ones, are listed with their names so it's a no brainer to slide the right one.

laduke commented 4 years ago

hey thanks for asking. any improvements probably won't come until version 2.

As a workaround, I've been using this bash completion script for a while and it seems to not be broken https://gist.github.com/laduke/67f935c7096e6bda25462c9394b4351d

source ~/zerotier-cli-completion.bash


Are you you thinking a GUI, or something in the terminal?

I leave and join a lot of networks too, and it does get kind of confusing...

bartmichu commented 4 years ago

Thanks @laduke for the bash-completion script. It doesn't fully solve my problem as it doesn't show network names, but I find it super useful anyways, I'll definitely keep using it.

GUI tool (i.e. tray icon) would be cool, but I think that fixing the command line experience is the real solution. Everything else about ZeroTier is auto-magic and pleasant to deal with, only managing known networks via command line sticks out.

bartmichu commented 4 years ago

@laduke just an idea: if bash-completion script was able to collect interface names from devicemap then it would totally solve the problem, right?

$ cat /var/lib/zerotier-one/devicemap
xxxxxxxxxxxxxxxx=company1
yyyyyyyyyyyyyyyy=company2
zzzzzzzzzzzzzzzz=company3

$ zerotier-cli join
company1 company2 company3

It's event better than my proposed solution as it gives me control over the network names (interface names really).

Edit: No wait, completion doesn't work that way.. :)