Help us shape the future of Go! Take the 2026 Go Developer Survey

router7

command module
v0.0.0-...-9d84d00 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

README

router7

This is the 0magnet fork of rtr7/router7 (Apache-2.0). It tracks upstream and adds one thing: the LAN-serving libraries are importable, so another Go program can embed router7's DHCPv4 and DNS servers instead of shelling out to dnsmasq.

Differences from upstream:

  • Module path is github.com/0magnet/router7.
  • dhcp4d, dhcp6, dns, oui, teelogger and multilisten moved from internal/ to pkg/. The appliance-only packages (netconfig, radvd, dhcp4, backup, diag, dyndns, notify) stay in internal/.
  • dhcp4d no longer imports internal/netconfig. It takes an optional ServerIPFunc to discover the server's own address; the default (InterfaceServerIP) reads it off the live interface, so an embedder needs no interfaces.json. cmd/dhcp4d passes netconfig.ServerIP, keeping the appliance's behavior byte-for-byte. This is what drops the netlink/nftables/wireguard dependency tree from the library's import graph.
  • dhcp4d, dns and oui carry an explicit //go:build linux tag so cross-platform consumers can import the tree unconditionally.
  • The daemons under cmd/ are decoupled from the gokrazy appliance runtime and take a --perm state directory, so they also run under a normal host OS (see contrib/host-os/).

GitHub Actions CI GoDoc Go Report Card

router7 is a pure-Go implementation of a small home internet router. It comes with all the services required to make a fiber7 internet connection work (DHCPv4, DHCPv6, DNS, etc.).

Note that this project should be considered a (working!) tech demo. Feature requests will likely not be implemented, and see CONTRIBUTING.md for details about which contributions are welcome.

For more details, please see router7.org

Documentation

Overview

Package main is a placeholder so that the packer can find the kernel in this directory.

Directories

Path Synopsis
cmd
backupd command
Binary backupd provides tarballs of /perm.
Binary backupd provides tarballs of /perm.
captured command
Binary captured streams network packets to wireshark via SSH, replaying buffered packets upon connection for retroactive debugging.
Binary captured streams network packets to wireshark via SSH, replaying buffered packets upon connection for retroactive debugging.
dhcp4 command
Binary dhcp4 obtains a DHCPv4 lease, persists it to /perm/dhcp4/wire/lease.json and notifies netconfigd.
Binary dhcp4 obtains a DHCPv4 lease, persists it to /perm/dhcp4/wire/lease.json and notifies netconfigd.
dhcp4d command
Binary dhcp4d hands out DHCPv4 leases to clients.
Binary dhcp4d hands out DHCPv4 leases to clients.
dhcp6 command
Binary dhcp6 obtains a DHCPv6 lease, persists it to /perm/dhcp6/wire/lease.json and notifies netconfigd.
Binary dhcp6 obtains a DHCPv6 lease, persists it to /perm/dhcp6/wire/lease.json and notifies netconfigd.
diagd command
Binary diagd provides automated network diagnostics.
Binary diagd provides automated network diagnostics.
dnsd command
Binary dnsd answers DNS requests by forwarding or consulting DHCP leases.
Binary dnsd answers DNS requests by forwarding or consulting DHCP leases.
dyndns command
Binary dyndns updates configured DNS records with the current public IPv4 address (of network interface uplink0).
Binary dyndns updates configured DNS records with the current public IPv4 address (of network interface uplink0).
netconfigd command
Binary netconfigd reads state from dhcp4, dhcp6, … and applies it.
Binary netconfigd reads state from dhcp4, dhcp6, … and applies it.
radvd command
Binary radvd sends IPv6 router advertisments.
Binary radvd sends IPv6 router advertisments.
internal
backup
Package backup generates tarballs of /perm.
Package backup generates tarballs of /perm.
dhcp4
Package dhcp4 implements a DHCPv4 client.
Package dhcp4 implements a DHCPv4 client.
diag
Package diag implements network diagnostics.
Package diag implements network diagnostics.
netconfig
Package netconfig implements network configuration (interfaces, addresses, firewall rules, …).
Package netconfig implements network configuration (interfaces, addresses, firewall rules, …).
notify
Package notify implements sending signals (such as SIGUSR1) to processes.
Package notify implements sending signals (such as SIGUSR1) to processes.
radvd
Package radvd implements IPv6 router advertisments.
Package radvd implements IPv6 router advertisments.
testing/dnsmasq
Package dnsmasq manages the process lifecycle of the dnsmasq(8) DHCP server.
Package dnsmasq manages the process lifecycle of the dnsmasq(8) DHCP server.
testing/pcapreplayer
Package pcapreplayer provides a net.PacketConn which replays a pcap file, and optionally records a new golden file.
Package pcapreplayer provides a net.PacketConn which replays a pcap file, and optionally records a new golden file.
pkg
dhcp4d
Package dhcp4d implements a DHCPv4 server.
Package dhcp4d implements a DHCPv4 server.
dhcp6
Package dhcp6 implements a DHCPv6 client.
Package dhcp6 implements a DHCPv6 client.
dns
Package dns implements a DNS forwarder.
Package dns implements a DNS forwarder.
multilisten
Package multilisten implements listening on multiple addresses at once.
Package multilisten implements listening on multiple addresses at once.
oui
teelogger
Package teelogger provides loggers which send their output to multiple writers, like the tee(1) command.
Package teelogger provides loggers which send their output to multiple writers, like the tee(1) command.

Jump to

Keyboard shortcuts

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