Michael Stapelberg
2b6ab5b2bd
dhcp4d: make hostname override settable from status page
2020-04-12 10:33:11 +02:00
Michael Stapelberg
e67fb4dd71
diagd: make output look good in a terminal, too
...
curl diagd.router7/
2020-03-11 22:12:00 +01:00
Michael Stapelberg
e34148d4e7
dhcp4d: add some leeway for lease activity
2020-02-06 18:48:19 +01:00
Michael Stapelberg
a543cb9a34
dhcp4d: add header describing whether lease is active
...
Should be interpreted by the DHCP server so that other programs don’t need to
hard-code the lease time.
2020-01-31 19:11:08 +01:00
Michael Stapelberg
a2ea8c2f95
cmd/dhcp4d: refactor for testing, add /lease/ test
2020-01-31 19:00:51 +01:00
Michael Stapelberg
4558cb61b4
dhcp4d: serve lease json data at /lease/<hostname>
2020-01-31 18:30:18 +01:00
Michael Stapelberg
3707ba290c
dhcp4d: move http.HandleFunc into logic
2020-01-31 18:25:02 +01:00
Michael Stapelberg
e76886dab4
dhcp4d: protect leases with a mutex
...
The HTTP handler runs in a separate goroutine.
2020-01-31 18:23:19 +01:00
Michael Stapelberg
fa82132962
dhcp4d: add HostnameOverride field
...
This can be used to permanently override a hostname, regardless of whether the
lease is static or not. We use a separate field because we want devices to be
able to change their hostname themselves, until we override it.
2019-08-30 09:06:21 +02:00
Michael Stapelberg
323cc42b8e
dhcp4d: polish status page, actually update it upon changes
2019-07-20 11:07:11 +02:00
Michael Stapelberg
c602f1d6b6
dhcp4d: introduce -interface flag
2019-07-20 10:50:30 +02:00
Michael Stapelberg
c211763b5d
dhcp4d: indent leases.json for easier human editing
2019-07-20 10:49:53 +02:00
Michael Stapelberg
373c83196d
dhcp4: make interface and state directory configurable
...
This is useful for manual testing on separate interfaces.
2019-06-06 07:52:08 +02:00
Michael Stapelberg
3dad1e9a23
dhcp4: use the configured (not the current) MAC address
...
This fixes a race where dhcp4 started before netconfigd had a chance to change
the hardware address on the uplink0 interface.
fiber7’s port security feature may result in an about hour-long internet outage
without this commit.
2019-02-19 09:39:16 +01:00
Michael Stapelberg
abeddabbb7
dhcp4d: restrict lease details page to internal IPs
2019-02-19 07:50:39 +01:00
Michael Stapelberg
6320b6c3a7
dhcp4d: display MAC vendor of each lease’s HardwareAddr
2019-01-06 18:02:01 +01:00
Michael Stapelberg
8df6329209
use renameio to write files atomically
2019-01-06 15:25:33 +01:00
Michael Stapelberg
f67d4ec93f
radvd: load extra prefixes from /perm/radvd/prefixes.json
2019-01-06 15:12:22 +01:00
Michael Stapelberg
bd8fc63b0e
dns: implement per-DHCP-lease dyndns
...
The HTTP API is easy to use from the command line or from Go:
% curl --data "host=sub&ip=192.168.33.44" -4 http://router7:8053/dyndns
ok
% host sub.$(hostname)
sub.midna has address 192.168.33.44
This can be used in combination with https://github.com/gokrazy/gdns
2019-01-06 14:41:26 +01:00
Michael Stapelberg
8c55c5ba44
dhcp4: switch to github.com/rtr7/dhcp4
...
All existing DHCPv4 packages I looked at were unappealing for one reason or
another, so we’re now using a little helper to glue github.com/google/gopacket
and github.com/mdlayher/raw together, which suffices for our use-case and gives
us more control.
2018-11-21 08:18:58 +01:00
Michael Stapelberg
fac1bf231e
netconfigd: notify dhcp4d to update its listeners
2018-10-29 18:14:01 +01:00
Michael Stapelberg
7d278289f0
captured: directly call NextPacket() to prevent hanging reads
...
Using Packets() spawns off a separate goroutine which calls NextPacket in a loop
until io.EOF is returned. This goroutine will stick around after Close()
returned, resulting in only the first wireshark connection working.
2018-10-23 09:56:07 +02:00
Michael Stapelberg
d9f5d95812
dhcp4d: export number of non-expired DHCP leases
2018-10-23 08:49:29 +02:00
Michael Stapelberg
ea4ffa7bec
OpenEthernet → NewEthernetHandle, remove kludge
2018-09-07 00:50:41 +02:00
Michael Stapelberg
b03596f1c5
nftables: use stateful object counters
...
This way, we can atomically get and reset them.
fixes https://github.com/rtr7/router7/issues/3
2018-08-08 23:15:21 +02:00
Michael Stapelberg
9131e7a99c
dhcp6: add missing err parameter
2018-07-14 15:17:12 +02:00
Michael Stapelberg
9153805e69
randomd moved to github.com/gokrazy/gokrazy/cmd/randomd
2018-07-14 12:51:28 +02:00
Michael Stapelberg
b347ed74c5
update import paths
2018-07-09 08:54:04 +02:00
Michael Stapelberg
88bf7d90eb
dhcp6: delay at least 10s before attempts
...
Otherwise we might exceed fiber7’s firewall rules and get blacklisted.
2018-07-03 17:36:46 +02:00
Michael Stapelberg
ff7aa8f2cb
add copyright notices
2018-06-28 20:08:23 +02:00
Michael Stapelberg
ab75e4a1b5
check for updateListeners errors
2018-06-28 20:08:23 +02:00
Michael Stapelberg
2b3cf0bf61
captured: use multilisten
2018-06-28 20:08:23 +02:00
Michael Stapelberg
c24eefbb51
diagd: expose machine-readable healthiness
2018-06-26 21:52:29 +02:00
Michael Stapelberg
72661b13ec
dnsd: listen on 8053 (metrics) on ipv6-net::1
2018-06-26 21:15:14 +02:00
Michael Stapelberg
4c7741a337
add backupd
2018-06-26 18:01:50 +02:00
Michael Stapelberg
86c9436e98
diagd: only listen on private addresses
2018-06-26 09:47:55 +02:00
Michael Stapelberg
89e1276ad4
dns: simplify resolving code
2018-06-26 09:33:23 +02:00
Michael Stapelberg
10df129c1f
dns: listen on all private IP addresses
2018-06-26 08:53:20 +02:00
Michael Stapelberg
60de127991
Describe all packages and binaries.
2018-06-25 20:12:51 +02:00
Michael Stapelberg
ae15230da3
dhcp4d: log in leases callback
2018-06-24 11:56:39 +02:00
Michael Stapelberg
57564e15d0
captured: increase ring buffer
...
5000 packets translated to just about 2 hours, which is not long enough.
2018-06-24 11:52:07 +02:00
Michael Stapelberg
bf2c12a69d
netconfigd: export ipv4/ipv6 packet/bytes counters on :8066
2018-06-23 19:56:34 +02:00
Michael Stapelberg
6705108481
add randomd: carries entropy across system restarts
...
As practiced by Debian (and others) and recommended in the urandom(4) manpage:
https://manpages.debian.org/stretch/manpages/urandom.4.en.html#Configuration
2018-06-23 17:46:55 +02:00
Michael Stapelberg
3ba84074c7
dhcp4d: send replies as unicast using raw sockets
...
Preferring unicast over multicast (which hogs a lot of airtime on WiFi networks)
is a best practice.
Some device/access point vendor combinations even seem to entirely eat (some?)
broadcast traffic (sometimes), e.g. my Apple iPhone SE/Ubiquiti UAP-AC-HD, so
that using unicast is required for reliable WiFi.
2018-06-23 17:46:53 +02:00
Michael Stapelberg
37bf17e1b7
make binaries cope with Squashfs root
2018-06-22 17:59:23 +02:00
Michael Stapelberg
24e2d5de00
dnsd: serve prometheus metrics on port 8053
2018-06-18 08:04:56 +02:00
Michael Stapelberg
0e6add220c
notify dyndns from netconfigd, i.e. _after_ applying addresses
2018-06-17 20:44:25 +02:00
Michael Stapelberg
7a46d077ee
dhcp4/dhcp6: notify dyndns if present
2018-06-17 19:30:30 +02:00
Michael Stapelberg
bb6b901b90
captured: implement a packet ring buffer
...
So that when you connect with Wireshark, you’ll see the most recent
packets (takes up to 7 MB of RAM).
2018-06-17 17:47:26 +02:00
Michael Stapelberg
2c302d976d
captured: plug goroutine leak from closed SSH connections
2018-06-17 16:49:37 +02:00