mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-30 01:38:53 +00:00
84 lines
4.0 KiB
Groff
84 lines
4.0 KiB
Groff
.TH "ZEROTIER\-CLI" "1" "December 2016" "" ""
|
|
.SH "NAME"
|
|
\fBzerotier-cli\fR \- control local ZeroTier virtual network service
|
|
.SH SYNOPSIS
|
|
.P
|
|
\fBzerotier\-cli\fP [\-switches] <command> [arguments]
|
|
.SH DESCRIPTION
|
|
.P
|
|
\fBzerotier\-cli\fR provides a simple command line interface to the local JSON API of the ZeroTier virtual network endpoint service zerotier\-one(8)\.
|
|
.P
|
|
By default \fBzerotier\-cli\fR must be run as root or with \fBsudo\fP\|\. If you want to allow an unprivileged user to use \fBzerotier\-cli\fR to control the system ZeroTier service, you can create a local copy of the ZeroTier service authorization token in the user's home directory:
|
|
.P
|
|
.RS 2
|
|
.nf
|
|
sudo cp /var/lib/zerotier\-one/authtoken\.secret /home/user/\.zeroTierOneAuthToken
|
|
chown user /home/user/\.zeroTierOneAuthToken
|
|
chmod 0600 /home/user/\.zeroTierOneAuthToken
|
|
.fi
|
|
.RE
|
|
.P
|
|
(The location of ZeroTier's service home may differ by platform\. See zerotier\-one(8)\.)
|
|
.P
|
|
Note that this gives the user the power to connect or disconnect the system to or from any virtual network, which is a significant permission\.
|
|
.P
|
|
\fBzerotier\-cli\fR has several command line arguments that are visible in \fBhelp\fP output\. The two most commonly used are \fB\-j\fP for raw JSON output and \fB\-D<path>\fP to specify an alternative ZeroTier service working directory\. Raw JSON output is easier to parse in scripts and also contains verbose details not present in the tabular output\. The \fB\-D<path>\fP option specifies where the service's zerotier\-one\.port and authtoken\.secret files are located if the service is not running at the default location for your system\.
|
|
.SH COMMANDS
|
|
.RS 0
|
|
.IP \(bu 2
|
|
\fBhelp\fP:
|
|
Displays \fBzerotier\-cli\fR help\.
|
|
.IP \(bu 2
|
|
\fBinfo\fP:
|
|
Shows information about this device including its 10\-digit ZeroTier address and apparent connection status\. Use \fB\-j\fP for more verbose output\.
|
|
.IP \(bu 2
|
|
\fBlistpeers\fP:
|
|
This command lists the ZeroTier VL1 (virtual layer 1, the peer to peer network) peers this service knows about and has recently (within the past 30 minutes or so) communicated with\. These are not necessarily all the devices on your virtual network(s), and may also include a few devices not on any virtual network you've joined\. These are typically either root servers or network controllers\.
|
|
.IP \(bu 2
|
|
\fBlistnetworks\fP:
|
|
This lists the networks your system belongs to and some information about them, such as any ZeroTier\-managed IP addresses you have been assigned\. (IP addresses assigned manually to ZeroTier interfaces will not be listed here\. Use the standard network interface commands to see these\.)
|
|
.IP \(bu 2
|
|
\fBjoin\fP:
|
|
To join a network just use \fBjoin\fP and its 16\-digit hex network ID\. That's it\. Then use \fBlistnetworks\fP to see the status\. You'll either get a reply from the network controller with a certificate and other info such as IP assignments, or you'll get "access denied\." In this case you'll need the administrator of this network to authorize your device by its 10\-digit device ID (visible with \fBinfo\fP) on the network's controller\.
|
|
.IP \(bu 2
|
|
\fBleave\fP:
|
|
Leaving a network is as easy as joining it\. This disconnects from the network and deletes its interface from the system\. Note that peers on the network may hang around in \fBlistpeers\fP for up to 30 minutes until they time out due to lack of traffic\. But if they no longer share a network with you, they can't actually communicate with you in any meaningful way\.
|
|
|
|
.RE
|
|
.SH EXAMPLES
|
|
.P
|
|
Join "Earth," ZeroTier's big public party line network:
|
|
.P
|
|
.RS 2
|
|
.nf
|
|
$ sudo zerotier\-cli join 8056c2e21c000001
|
|
$ sudo zerotier\-cli listnetworks
|
|
( wait until you get an Earth IP )
|
|
$ ping earth\.zerotier\.net
|
|
( you should now be able to ping our Earth test IP )
|
|
.fi
|
|
.RE
|
|
.P
|
|
Leave "Earth":
|
|
.P
|
|
.RS 2
|
|
.nf
|
|
$ sudo zerotier\-cli leave 8056c2e21c000001
|
|
.fi
|
|
.RE
|
|
.P
|
|
List VL1 peers:
|
|
.P
|
|
.RS 2
|
|
.nf
|
|
$ sudo zerotier\-cli listpeers
|
|
.fi
|
|
.RE
|
|
.SH COPYRIGHT
|
|
.P
|
|
(c)2011\-2016 ZeroTier, Inc\. \-\- https://www\.zerotier\.com/ \-\- https://github\.com/zerotier
|
|
.SH SEE ALSO
|
|
.P
|
|
zerotier\-one(8), zerotier\-idtool(1)
|
|
|