vpnrouter

package
v1.3.112 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package vpnrouter pkg/vpnrouter/lan.go c3-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

func StartLAN(ctx context.Context, ifaceName, permDir string, gw *meshgw.Gateway) error

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.

Directories

Path Synopsis
Package meshgw pkg/vpnrouter/meshgw/dns.go c3-app-vpn
Package meshgw pkg/vpnrouter/meshgw/dns.go c3-app-vpn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL