Documentation
¶
Overview ¶
Package vpnrouter pkg/vpnrouter/lan.go c4-app-vpn
StartLAN runs an embedded, pure-Go DHCPv4 + DNS server for the vpn-router's downstream (LAN/WiFi) interface, replacing the external dnsmasq the app used to shell out to. Built on the vendored router7 handler libraries (pkg/vpnrouter/router7) — see that package's doc.go for provenance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartLAN ¶
StartLAN serves DHCPv4 (:67) and DNS (:53) on ifaceName — the vpn-router's downstream interface — in-process, replacing dnsmasq. The gateway address is the interface's own IPv4 (assigned by the app's setupLANInterface); clients are handed addresses starting at gateway+1 and given the gateway as their router and DNS server. LAN hostnames resolve from the live DHCP leases, which persist under permDir/dhcp4d/leases.json across restarts. Blocks until ctx is canceled or a server exits with an error. Requires CAP_NET_* / root.
When gw is non-nil the MESH GATEWAY is layered on: gw's `.dmsg` / `.skynet` zone handlers are registered on the DNS mux so clients resolve mesh names to synthetic IPs (the transparent proxy that dials them is started separately by the caller). gw nil = plain LAN DNS only.
Types ¶
This section is empty.