Reach a LAN through a subnet router
Reach devices that can't run Peerlify — printers, cameras, a whole office or cloud subnet — through one device in the network that routes for them.
Updated · ·By Ivan Vyshniak
Nothing on this page changes with your selection.
A subnet router is a device in your network that forwards traffic to a LAN it is attached to. Other members then reach the addresses on that LAN (192.168.1.50, for example) without Peerlify being installed on those machines. Use one for printers, cameras, NAS boxes and appliances, or to reach a whole office or cloud subnet through a single enrolled device.
Setting one up takes two steps, by two parties:
- The router device advertises the subnets it can reach.
- An admin approves them.
After that, every member of the network has the route. Nothing is configured on the devices that use it.
Platforms
| Windows | macOS | Linux | |
|---|---|---|---|
| Reach a routed subnet | ✓ | ✓ | ✓ |
| Be a subnet router | ✓ | – | ✓ |
The router has to be attached to the LAN it routes, and switched on whenever the LAN needs to be reachable.
1. Advertise the subnets
On the device that will route, list the subnets as IPv4 CIDRs, separated by commas:
peerlify subnet-router advertise 192.168.1.0/24,10.0.0.0/8To stop advertising:
peerlify subnet-router advertise offTo check what the device advertises and what it is routing:
peerlify subnet-router statusAdvertising alone routes nothing. A subnet is used only once an admin approves it.
2. Approve them
On the console's Devices page, the device shows a Subnets badge. While it offers a subnet that nobody has approved, the badge is amber and says how many are waiting, for example Subnets 0 — 2 to approve.
- Open the device's ⋯ menu and choose Edit subnet routes….
- Tick the subnets other members may reach through this device.
- Click Save.
Requires the Owner, Admin or IT admin role. The badge then shows the number of subnets the device routes, and members get the routes within a few seconds.
Approval is per device and per subnet. If the device later advertises another subnet, that one waits for approval; the ones you approved keep working. To stop routing a subnet, untick it and save.
An approval is kept when the device stops advertising a subnet, so advertising it again needs no second approval. Such a subnet stays in the dialog marked not advertised; untick it to remove the approval.
Approvals can also be set with the REST API (POST /v1/devices/{id}/subnet-routes); see API access.
How members use it
Automatically. Every device in the network installs a route for each approved subnet and sends traffic for it to the router, over the same encrypted path as any other Peerlify traffic. Connect to the LAN address as if you were on that LAN:
ssh admin@192.168.1.50When two approved subnets overlap, the longest prefix wins: with 10.0.0.0/8 on one router and 10.0.5.0/24 on another, traffic for 10.0.5.20 goes to the second, and the rest of 10.0.0.0/8 to the first.
What the LAN sees
The router applies source NAT: devices on the LAN see connections arriving from the router's own LAN address, not from the Peerlify address of the member that opened them. Because replies go back to the router, the LAN needs no return route and no change on its own gateway.
It also means LAN hosts can't tell members apart by address, and connections can only be opened from the Peerlify network toward the LAN, not the other way round.
High availability
To keep a subnet reachable when a router is down, advertise and approve the same subnet on two devices.
One of them is used at a time: the online router that has been in the network longest. When it goes offline, the other takes over, and members switch without any action. When the first comes back, it is used again. A switch-over takes about a minute, the time it takes for a device that stopped responding to count as offline; connections that were open through the old router have to be reopened.
The subnets have to match exactly. 192.168.1.0/24 on one router and 192.168.0.0/16 on another are two different routes, and the longest-prefix rule decides between them rather than failover.
Access control
A member can reach a routed subnet on the ports the access rules let it reach the router device on. There are no separate rules for the addresses behind a router.
So if your access rules let the support group reach the router on TCP 22 and 443, the group can reach every address in the routed subnet on TCP 22 and 443, and nothing else there. A member with no rule to the router can't reach the subnet at all. With the default policy, in which everyone may reach everything, every member can reach every routed subnet.
To limit who can use a subnet router, tag it and write the rules against the tag. See Access control.
Limits
- IPv4 only, with a prefix length from
/8to/32. - Up to 32 subnets per device.
- A subnet may not overlap the network's own subnet (shown on Settings → Subnet allocation). Such a subnet is ignored when advertised and refused when approved.
- A default route (
0.0.0.0/0) isn't a subnet route. To send internet traffic through a device, use an exit point. - Loopback, link-local and multicast ranges are refused.
- A router whose owner's account is suspended routes nothing, and neither does a device that isn't an approved member.