How Peerlify works

The parts of Peerlify, what each one does, and what happens between "install the client" and "my SSH session connects".

Updated · ·By Ivan Vyshniak

Nothing on this page changes with your selection.

Peerlify connects your devices into a private network. Each device gets an address in that network and can reach the other devices at their addresses, whether they are on the same LAN or on opposite sides of the internet. Traffic between devices is encrypted end to end, and an access policy decides who may connect to what.

The parts

PartWhere it runsWhat it does
Peerlify clientOn each of your devicesA background service (peerlify-daemon) plus the peerlify command-line tool. On Windows and macOS, a desktop app too. The service owns a virtual network adapter and encrypts and sends your traffic.
Consoleweb.peerlify.comWhere you manage networks, members, devices, access rules and settings.
Sign-in servicelogin.peerlify.comSigns people in through GitHub, Google, Microsoft, Apple or your own identity provider.
Control planeRun by PeerlifyKeeps track of which devices belong to which network, their public keys and addresses, and sends each device its list of peers and the rules that apply to it.
RelaysRun by PeerlifyForward encrypted traffic between devices that can't reach each other directly. They can't read it.

What happens when a device joins

  1. The device creates its keys. On first start, the service generates two key pairs on the device. Private keys never leave the device. See Security model.
  2. Someone signs it in. peerlify login prints a link; a member opens it, signs in and picks a network. Or the device uses an auth key.
  3. The control plane admits it. The device gets an address from the network's subnet, for example 100.100.0.7, and a name. If the network requires device approval, it waits until an admin approves it.
  4. The device receives its peer list. The control plane streams the list of other devices in the network (their names, addresses, public keys and relays) together with the access rules for this device, and keeps it up to date every few seconds.
  5. The adapter comes up. The service creates the virtual adapter with the device's address. On Windows and macOS it also adds the names of the peers it may connect to into the hosts file.

What happens when an application connects

  1. An application, say ssh, sends a packet to 100.100.0.12.
  2. The operating system routes it to the Peerlify adapter. The service looks up which peer owns that address.
  3. If there is no encrypted session with that peer yet, the service sets one up using both devices' keys. Packets sent in the meantime wait briefly.
  4. The packet is encrypted and sent. The first packets go through a relay. At the same time, the two devices try to find a direct path, and once one works, traffic switches to it. See Direct and relayed connections.
  5. The receiving device decrypts the packet, checks that it really came from the device that owns the source address, checks its access rules, and delivers it to its own network stack.

The control plane is never in the path of your traffic. Relays only see encrypted packets.

What each side knows

  • The control plane knows your devices' public keys, names, operating systems, client versions, public and local IP addresses, and which relay each uses. On Business and Enterprise plans it also receives connection summaries (who connected to whom, on which port, how many bytes) for the activity logs. It never receives private keys or the content of your traffic.
  • A relay sees the public IP addresses of the devices using it, their public keys, which device is talking to which, and the size and timing of the encrypted packets it forwards.
  • Devices in the network receive the name, address, public key and tags of every other approved device, whether or not the policy lets them connect.

See Security model for the details and the trust boundaries.

If Peerlify's servers can't be reached

  • The control plane is down: devices keep using the last peer list and rules they received, and existing and new connections between them keep working. Changes made in the console don't arrive until it's back. A device whose service restarts during the outage has no peers until it can reach the control plane again.
  • A relay is down: devices reconnect to another relay. Direct connections aren't affected.

Limits worth knowing

  • Each device has an IPv4 and an IPv6 address in the network. Names, exit points and subnet routers use IPv4.
  • A machine without the client is reachable only through a device that routes its network for the others. See Subnet routers.
  • A network holds at most as many devices as its subnet has addresses. Devices on clients released before the network's subnet was sent to them (2.7.1 and earlier) only reach peers in their own /24. See Network settings.

Next steps

Was this page helpful?