Devices
How a device is identified, named and addressed, who owns it, what its status means, how its session expires, and how other devices find it by name.
Updated · ·By Ivan Vyshniak
Nothing on this page changes with your selection.
A device is a computer running the Peerlify client. This page explains the properties every device has and how they change over time.
Identity
On its first start, the client generates the device's keys and stores them on the device (in node.secret; see Device security). The keys are the device's identity:
- Signing out and back in, restarting, pausing and upgrading all keep the same identity.
- Reinstalling keeps it as long as the client's state folder is left in place. Uninstallers leave it by default.
- Deleting the state folder gives the machine a new identity. It then appears as a new device.
The control plane also gives each device a 9-digit device ID, shown on the device's page in the console and usable in rules as client:<deviceId>.
Name and address in a network
When a device joins a network it gets, in that network:
- a name. With browser sign-in, it's the name entered on the sign-in page (by default the computer's hostname, or the name it last had in another network; without dots, up to 32 characters). With an auth key, it's the computer's hostname. If another device already uses the name,
-1,-2and so on is appended. - an address from the network's subnet: the lowest free address, such as
100.100.0.7.
Both stay the same when the device signs in again. Admins can rename a device or change its address on the Devices page. See Manage devices.
Who owns a device
- A person, when it was signed in through the browser, or with an auth key that has no tags. The console shows the person under the device's name. Rules with
email:,group:androle:selectors match it. - Its tags, when it has at least one tag. The console shows Shared resource. Only
tag:,client:,ip:and*selectors match it, and it can't switch networks.
Adding the first tag to a person's device turns it into a shared resource. Removing the last tag from a shared resource signs it out; someone has to sign it in again.
Status
| Status | Meaning |
|---|---|
| Pending | Waiting for an admin to approve it. It has an address but sees no peers, and no peer sees it. Only happens when Manual device approval is on. |
| Online | Approved, and it has checked in with the control plane in the last 60 seconds. Running clients check in every 7 seconds. |
| Offline | Approved, but not checked in recently, paused with peerlify stop, or signed out. |
| Denied, Revoked | Blocked. Neither the console nor the REST API currently sets these statuses. A device in either state sees no peers and no peer sees it, even if it signs in again. |
Session and expiry
Signing a device in creates a session: a token stored on the device that lets it talk to the control plane. Sessions are separate from your sign-in to the console and aren't checked against your identity provider after sign-in.
- A session lasts the number of days set in Settings → Device Management → Default key expiry: 180 by default, up to 3650.
- An admin can turn expiry off for one device with Disable session expiry. The device then shows never expires.
- Both settings are applied when the device next signs in. They don't change the session it already has.
When a session expires or is revoked, the device removes its adapter, stops reaching peers, and logs Control-plane session lost. Sign it in again with peerlify login, or with an auth key that is still valid.
Despite its label, Default key expiry doesn't rotate the device's keys. Device keys change only if the identity file in the state folder is deleted or can't be read.
Ephemeral devices
Devices enrolled with an auth key that has Ephemeral turned on are removed from the network automatically. This suits short-lived machines such as CI runners. An ephemeral device is removed:
- immediately, when it signs out with
peerlify logout(about 20 seconds later with clients from 2.7.1 and earlier), or - about 20 seconds after it went offline, however it went offline: the machine was destroyed, the service was stopped or the machine shut down,
peerlify stoppaused it, or it never checked in after signing in.
A device that comes back within those 20 seconds, for example after a quick service restart, keeps its place and address.
Devices you revoked or denied are never removed this way, so that signing in again with the same key can't undo your decision.
A removed ephemeral device stays offline until it signs in again
If an ephemeral device is removed while it is off, for example during a reboot or a slow update, it doesn't rejoin by itself when it comes back: it reports no error and sees no peers. Run peerlify login --auth-key=… again. Don't use ephemeral keys for machines that should survive a reboot.
A removed ephemeral device that signs in again joins as a new device: it gets the key's tags again and, if the network has Manual device approval on, waits for approval again. A removed device no longer counts toward the plan's device limit.
Finding devices by name
On Windows and macOS, the client writes the names of the peers it may connect to into the system hosts file, between the lines # >>> MJ-TAP DNS INJECTION >>> and # <<< MJ-TAP DNS INJECTION <<<. Each peer gets one line with two names:
100.100.0.12 build-server build-server.k3x9q2m7pa.peerlify.net- The first part is the device's name, lowercased, cut at the first dot, with characters other than letters, digits,
-and_replaced by-. A device namedAlice's Laptopbecomesalice-s-laptop. - The middle part is the network ID.
- The short name is left out when two peers would share it.
Only peers the access policy lets this device connect to (or shadow) are written. The block is removed when the device signs out or pauses.
On Linux, the client doesn't write the hosts file. Use addresses, or add your own entries. peerlify ping and peerlify acls --query still accept names on Linux, because the client resolves them itself.
There is no DNS server: these names don't resolve outside your devices' hosts files. The Domain shown on a device's page in the console is not normalized, so copy the name from peerlify list peers instead.