Reach a LAN through subnet routes
Subnet routes let devices in a mesh network reach the LAN behind a gateway, such as an office NAS or printer. These LAN devices don’t each need FlowMesh installed.
Before you begin
The steps below use a Linux gateway office-gw and the example subnet 192.168.10.0/24. Replace these with your actual subnet, and confirm that:
- The gateway has already joined the mesh network and can itself reach the target LAN devices.
- You have admin privileges on the gateway, and it is allowed to forward traffic.
- You or a mesh network admin have permission to approve routes and configure access rules.
- The LAN the accessing device is on doesn’t conflict with the target subnet; for example, if both ends use
192.168.1.0/24, resolve the overlapping subnets first.
1. Enable forwarding on the gateway
Temporarily enable IPv4 forwarding on Linux:
sudo sysctl -w net.ipv4.ip_forward=1If you advertise IPv6 subnets, also enable net.ipv6.conf.all.forwarding=1. Settings made with sysctl -w may be lost after a reboot; for ongoing use, write the configuration to a distribution-managed file in /etc/sysctl.d/ and verify the result after rebooting.
The FlowMesh client doesn’t turn on kernel forwarding for you. On OpenWrt, use the 共享本地局域网 (Share local LAN) setting in LuCI; don’t copy the Linux service management commands.
2. Advertise subnets
On the Linux gateway, run:
sudo flowmesh set --advertise-routes=192.168.10.0/24To share multiple subnets, separate them with commas and keep every subnet that still needs to be advertised. This parameter sets the complete list; it doesn’t append an entry to the existing list.
3. Approve routes and set permissions
A mesh network admin signs in to the Wanflow Console, clicks 万联组网 (FlowMesh) in the left navigation, opens the target mesh network and goes to the 子网路由 (Subnet routes) tab. Subnets advertised by the gateway appear in the list, with 发布者 (Publisher) showing the gateway that advertised them and the status 待批准 (Pending approval). After checking the subnet, click 批准 (Approve) on that row.
After approving, also confirm that access control allows the members who need it to reach the corresponding devices and ports; see Access and access control. The 入流量 (Inbound traffic) and 出流量 (Outbound traffic) columns in the list help confirm whether traffic is passing through the route.
Advertising is not approving, and approving a route does not allow all access.
4. Accept routes on the accessing device
On the remote Linux device, run:
sudo flowmesh set --accept-routes=trueOpenWrt accessing devices use the accept_routes setting in LuCI or UCI; see the OpenWrt guide. Other clients use the routing options their version provides.
5. Verify access
First confirm that the accessing device can communicate with the gateway over the mesh network, then connect to an actual service on the LAN device. For example, if the NAS’s LAN address is 192.168.10.20, access the web address and port it actually exposes.
If access fails, check in this order: whether the gateway can reach the target, whether the route is approved, whether the accessing device accepts routes, whether the access policy allows it, and whether the target’s firewall allows it.
Source addresses and return traffic
SNAT is enabled by default, so LAN devices see the gateway as the source. If you turn off --snat-subnet-routes, you need to configure LAN devices separately with a route back to the mesh IP address range; the IPv4 mesh IP address range is 100.64.0.0/10. Without a return route, requests arrive but responses can’t get back.
Stop sharing
The following command withdraws all subnet advertisements from this device; to remove only one subnet, list the subnets you’re keeping again instead:
sudo flowmesh set --advertise-routes=Also check the route status in the console. If you also need to reach the internet through a node, continue with Exit nodes.