Troubleshoot connectivity

A device can't reach another one, a connection stays on the relay, or names don't resolve — how to find the cause and fix it.

Updated · ·By Ivan Vyshniak

Showing Windows instructions.

This page changes with your operating system.

Start here

Run these on the device that can't connect:

shell
peerlify status
peerlify list peers -s
peerlify ping <peer> -c 3
  • If status shows Daemon: stopped, run peerlify start.
  • If status has no Network and Address lines, the device isn't connected to a network. See Sign-in and enrollment problems.
  • If status shows a Policy: line reading not received yet, wait a few seconds; the device accepts and lists nothing until its rules arrive.

Then find the matching problem below.

The peer isn't in peerlify list peers

Causes

  • The access policy doesn't let this device connect to the peer. list peers only shows peers this device may open connections to.
  • The peer isn't approved: it's Pending, or has been removed or revoked.
  • The two devices are in different networks.

Diagnose

  1. In the console, open Devices in this device's network and find the peer. Check its Status.
  2. Run peerlify acls on this device and look for a rule in Outbound ACL whose destination covers the peer.

Fix

Add or correct a rule. See Write your first rule. Approve the peer if it's pending.

Verify

peerlify list peers shows the peer within about 10 seconds of saving.

peerlify ping times out

Causes

  • The peer is offline, paused (peerlify stop), or its service isn't running.
  • Neither a direct path nor a relay connection works from one of the devices.

Diagnose

  1. In the console, the peer's status should be Online.
  2. On both devices, run peerlify telemetry and check the Relay line ends with (connected=True). If not, the device can't reach any relay: check that it can make outbound TCP connections to port 5879, 443 or 80. See Firewall and network requirements.

Fix

Start the peer's service, or allow outbound traffic to Peerlify's relays.

Verify

peerlify ping <peer> prints pong from ….

Ping works, but the application doesn't connect

peerlify ping proves that Peerlify can reach the peer. It doesn't test the application's port.

Causes

  • No rule allows that port or protocol to the peer. Rules are checked by the receiving device.
  • The peer's own firewall blocks the port, or the service isn't listening on the Peerlify interface.

Diagnose

  1. On the receiving device, look in the client's log for Dropped inbound packet by ACL. The reason tells you whether no rule matched (no_matching_rule_default_deny) or a drop rule matched (Deny:<rule name>). See Find the logs.
  2. Test the port: Test-NetConnection <address> -Port <port> on Windows, nc -vz <address> <port> on macOS and Linux.
  3. On the receiving device, check the service listens on its Peerlify address or on all addresses (0.0.0.0).

Fix

Add a rule for the port and protocol, written as strings ("ports": ["5432"]). See How rules are evaluated. Open the port in the device's firewall.

Verify

The port test succeeds, and the log no longer shows drops for it.

Small requests work, but large transfers stall

SSH signs in but freezes when a command prints a lot, web pages load partly, a file copy stops at 0 bytes, or a remote desktop connects and then hangs. peerlify ping still works.

Background

The Peerlify network adapter has an MTU of 1280 bytes: the operating system never hands Peerlify a packet larger than that, and TCP sizes its segments to fit. Over a direct connection, Peerlify puts each packet into an encrypted UDP datagram, which adds 50 to 66 bytes plus the UDP and IP headers. A full-size packet therefore crosses the network between the two devices as a datagram of about 1,360 to 1,380 bytes over IPv4, and about 1,400 bytes over IPv6. Relayed traffic travels over TCP and isn't affected.

Causes

  • A link between the two devices carries smaller packets than that and drops the larger datagrams instead of fragmenting them. This happens over some VPNs and tunnels (IPsec, GRE), some mobile and satellite links, and on routers or firewalls that drop IP fragments.
  • Small packets — pings, keep-alives and the connection handshake — still fit, so the direct connection looks healthy and stays in use. Peerlify doesn't currently shrink its packets or move to a relay when only large packets are lost.

Diagnose

  1. Run peerlify list peers -s. If the peer shows ERPFServer (…) (relayed), this isn't the cause.
  2. Send a full-size packet across Peerlify with fragmentation forbidden, using the peer's Peerlify address. 1252 is 1280 minus the IP and ICMP headers. The peer's access policy must allow ICMP from this device.
  3. If a normal ping 100.100.0.12 gets replies and this one doesn't, large datagrams are being lost between the two devices.
  4. If you can reach the other device's real address directly (for example over the VPN that links two sites), run the same command against that address with 1372 instead of 1252 (a 1,400-byte packet). If that fails, the path carries less than 1,400 bytes.
Windows
powershell
ping -f -l 1252 100.100.0.12
macOS
shell
ping -D -s 1252 100.100.0.12
Linux
shell
ping -M do -s 1252 100.100.0.12

Fix

  • Raise the MTU of the link between the devices to at least 1,400 bytes, or let firewalls on the path pass fragmented UDP.
  • If you can't change the link, stop Peerlify from using it for direct connections: add its address range to Relay:ExcludedAddressRanges on both devices (see Client configuration). The devices then connect over another path or through a relay.

Verify

The full-size ping gets replies, or peerlify list peers -s shows the devices on another path, and the transfer completes.

Large UDP messages or large pings never arrive

Applications that send UDP messages larger than about 1,250 bytes (some streaming, gaming and monitoring tools, NFS over UDP) lose those messages. ping with a size above 1252 times out, while smaller pings work. TCP connections aren't affected.

Cause

The sending computer splits any packet larger than the adapter's 1,280-byte MTU into IP fragments before Peerlify sees it. The receiving device drops every fragment after the first, because only the first carries the port numbers the access policy is checked against. Traffic through an exit point is treated the same way.

Diagnose

On the receiving device, look in the client's log for Dropped inbound packet by ACL with reason=non_initial_fragment_drop. See Find the logs.

Fix

Configure the application to keep each UDP message to 1,252 bytes or less, or to use TCP. A ping larger than 1252 bytes failing is expected, not a fault.

Verify

The log no longer shows non_initial_fragment_drop for the application's traffic.

The connection stays on the relay

peerlify list peers -s shows ERPFServer (…), or pings show via RELAY(…), for a long time.

Causes

  • One of the devices is behind a NAT that gives each destination a different port (common on mobile networks and some corporate firewalls). Peerlify doesn't traverse these.
  • Outbound UDP is blocked on one side.
  • The connection is new: direct paths are found in parallel with the first relayed packets, usually within seconds.

Diagnose

  1. Run peerlify ping <peer> --until-direct -c 30 to give the search time.
  2. Run peerlify telemetry on both devices. Local endpoints lists the addresses each device offers; an entry with its public address shows that STUN (UDP 3478) works. In the peer table, UDP Cands is how many of the peer's addresses this device knows.

Fix

  • Allow outbound UDP from the device to any address and port.
  • Allow UPnP, NAT-PMP or PCP on the router, which lets the client open a port mapping.
  • If you control the router, set a fixed TapClient:Relay:LocalUdpPort on one device and forward that UDP port to it. See Client configuration.

Relayed connections work; they're slower. If the cause is the NAT type, the connection stays relayed.

Verify

peerlify list peers -s shows p2p (…) for the peer.

Names don't resolve

Causes

  • The device runs Linux. The client doesn't add names to the hosts file on Linux.
  • The access policy doesn't let this device reach the peer. Only reachable peers are added.
  • You're using a different form of the name. Names are lowercased and cut at the first dot; a device named Bob's PC is bob-s-pc.
  • Two devices share the same short name, so neither short name is added. Use the full name.

Diagnose

Run peerlify list peers and use the name it shows. On Windows and macOS, look for the block starting # >>> MJ-TAP DNS INJECTION >>> in the hosts file.

Fix

Use the name from peerlify list peers, or the address. On Linux, add entries to /etc/hosts yourself.

Verify

ping <name> (the operating system's ping) resolves to the peer's address.

Some devices can reach each other and others can't

Cause

Clients from 2.7.1 and earlier treat the network as a /24: such a device only exchanges traffic with peers whose addresses share the first three numbers with its own. In a network with more than 254 devices, or after assigning addresses by hand, some devices end up in a different /24.

Diagnose

On the Devices page, compare the addresses and client versions of the two devices. Devices in different /24s, such as 100.100.0.12 and 100.100.1.4, can't reach each other if either runs 2.7.1 or earlier.

Fix

Update the client on both devices. Until you can, use Edit IP to move them into the same /24. See Network settings.

Every device lost its connections at once

Causes

  • The network's plan lapsed, or Peerlify suspended it. The console shows an amber or red bar.
  • The device's session expired or was revoked: the log shows Control-plane session lost.

Fix

Renew the plan (see Plans and limits), or sign the device in again with peerlify login.

After sleep or a network change

The client reconnects by itself when the network changes. On macOS it also reacts to waking from sleep. On Windows and Linux, recovery after sleep depends on network-change events and may take longer. If a device stays disconnected, run peerlify stop and then peerlify start.

Next steps

Was this page helpful?