Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - eseelke

#1
I finally figured out how to do this using the api. Here is how, in case this may help someone else.

Set the variables needed.

key=apikey
secret=apisecret
ztnid=zerotier_network_uuid


Then the following command will toggle the enable button. So, assuming it is not checked, this will enable it.

curl -X POST -d "" -k -u "$key":"$secret" http://localhost/api/zerotier/network/toggle//$ztnid
#2
Virtual private networks / Enable Zerotier via cli
April 04, 2023, 06:15:47 PM
Hello,

I know this is going to sound unorthodox, but I am needing a way to enable the Zerotier network via a script.

I am using OPNsense in an ESXI server to help a few individuals with remote support. They all use the same config with the exception of the physical LAN subnet. So, instead of installing OPNsense manually, I setup a basic install with the default settings. I then installed the plugins needed, such as Zerotier. I added a script in the root folder and then saved the VM as an ova file.

I have an automated ESXi installer that will pull this ova and then run it. My idea is to have the script in OPNsense automatically run once at next boot. This way I can remotely access and not need to visit site, which is a couple hundred miles away.

The script pulls a saved xml backup, changes the subnet, and restores it. I have the Zerotier network info in this xml file. But, if I have it enabled, Zerotier does not run. It only works if the xml has it disabled and then I login to the webui and enable it by placing a checkmark in the Enable box. I assume that checking this box runs a script or series of commands, such as "zerotier-cli join NETWORK". I have tried this particular command. It gave a successful message, but did not connect. So, there must be more that need to be done.

How can I find out what commands are needed?