fenranxueluo1

lanbridge

fenranxueluo1

lanbridge is a cross-platform Go LAN-bridging tool that connects two non-routable subnets over a single encrypted TCP tunnel and forwards mDNS / SSDP discovery.

v0.1.0
Published at
24d ago
1
Stars
2
Download
Synced at
13d ago

Latest release

v0.1.0Nov 2, 2026, 02:15 PM
Downloads slow? Switch the source anytime above

README

Project Overview

lanbridge is a Go utility that bridges two otherwise unreachable LANs. Machines A and B sit in different subnets — say A on 192.168.x.x over cellular, B on a corporate 10.x.x.x — and cannot Ping each other. lanbridge runs one instance on each side, establishes a TLS-encrypted TCP tunnel, and spins up a TUN adapter on both sides to make the two LANs behave as one subnet. mDNS, SSDP, and NBNS are also forwarded so Chromecast, AirPlay, Apple TV, and printers keep working across the bridge.

Item Value
Platform Windows, Linux, macOS
Language Go 1.21+
Transport TLS-encrypted TCP tunnel
Virtual adapter TUN (admin required)
Broadcast forwarding mDNS, SSDP, NBNS
License MIT

One Go binary on each side makes two unreachable LANs look like one — Chromecast and AirPlay work across it too.

Key Features

  • TLS-encrypted TCP tunnel: handshake with a pre-shared key; middlemen see nothing
  • TUN virtual adapter: spins up a virtual NIC on each end, merging both subnets
  • UDP / TCP proxy mode: if you don't want TUN, pure proxy mode forwards specific ports
  • mDNS forwarding: Chromecast, AirPlay, Apple TV, printers, and other multicast-dependent devices become visible across the bridge
  • SSDP / NBNS forwarding: Windows SMB file sharing is discoverable across subnets
  • One-shot CLI: lanbridge up starts, lanbridge down stops; JSON config controls the virtual subnet
  • Config management: config.json holds the peer address, pre-shared key, virtual subnet, and forward list
  • Auto-reconnect: rebuilds the tunnel after Wi-Fi → cellular switches

Interface and Operation

Pure CLI, no GUI.

  • CLI: lanbridge up --config config.json, lanbridge status, lanbridge down
  • Config: JSON with peer address, pre-shared key, virtual subnet range, and forward list

Target Audience

  • Remote workers bridging a work PC to a home NAS
  • Users wanting Chromecast / AirPlay across cellular and Wi-Fi
  • DevOps running cross-subnet Docker clusters
  • People avoiding Tailscale / ZeroTier who still want LAN bridging

Quick Start

  1. Grab the lanbridge binary for both machines (A and B)
  2. On A, generate a pre-shared key: lanbridge genkey
  3. Write a config.json on each side with the key, peer IP, and virtual subnet
  4. Run lanbridge up --config config.json on both (admin/sudo needed for TUN the first time)
  5. A and B plus everything in their respective LANs are now reachable; Chromecast works across the bridge

Core Advantages

  • Single Go binary, three platforms
  • TLS encrypted: middlemen can't sniff; more controllable than Tailscale / ZeroTier relay models
  • Full TUN bridging: not a few ports proxied — the whole LAN graph merges
  • Broadcast forwarding: Chromecast, AirPlay, and SMB actually work across the bridge

System Requirements

Item Requirement
OS Windows 10+, macOS 11+, Linux (Debian / Ubuntu / Arch)
Privilege admin / sudo for TUN; proxy-only mode needs none
Go 1.21+ (source build only)
Network the two machines must be able to reach each other over TCP

Notes

  • TUN needs admin: UAC on Windows, sudo on macOS / Linux; proxy-only mode skips this
  • Do not collide subnets: don't pick a virtual subnet already used on either side (e.g. don't use 192.168.1.0/24 on both)
  • Performance = bottlenecked by the link between A and B: lanbridge itself adds almost no overhead
  • Broadcast forwarding can be noisy: lots of devices mean lots of mDNS — whitelist the forwards when you can

Release history

Sort