Expand LAN to 10.0.0.0/22 with static/reserved/dynamic/spare zones

Splits the LAN into four /24 zones: 10.0.0.0/24 static (no DHCP, DNS
only), 10.0.1.0/24 fixed DHCP reservations by MAC, 10.0.2.0/24 dynamic
DHCP pool, 10.0.3.0/24 spare/unused. ipadm now derives the required
subnet from whether a host has a MAC, auto-assigns free IPs, and
auto-migrates a host's IP when its MAC is added/removed. Migrated the
existing archerc80 reservation from 10.0.0.2 to 10.0.1.2.

Also fixes a latent bug found while doing this: dnsmasq's SIGHUP
(`systemctl reload`) only re-reads /etc/hosts, not the conf-dir files
ipadm writes to, so config changes were silently not applied on
reload. ipadm now restarts dnsmasq instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-21 08:57:58 +02:00
co-authored by Claude Sonnet 5
parent 78beedeabc
commit c135f205fa
10 changed files with 364 additions and 112 deletions
+9 -2
View File
@@ -4,8 +4,15 @@ bind-interfaces
except-interface=enp3s0
except-interface=lo
# DHCP für 10.0.0.0/24
dhcp-range=10.0.0.100,10.0.0.200,255.255.255.0,12h
# DHCP für 10.0.0.0/22, aufgeteilt in vier /24er:
# 10.0.0.0/24 statische Adressen (kein DHCP, nur DNS via ipadm)
# 10.0.1.0/24 feste DHCP-Reservierungen anhand MAC-Adresse (via ipadm, siehe hosts.conf)
# 10.0.2.0/24 dynamischer Pool für alle anderen Clients (dieser dhcp-range)
# 10.0.3.0/24 Reserve, aktuell unbenutzt
# Ein dhcp-range genügt: die Netzmaske definiert das gesamte /22 als ein
# DHCP-Netz, dhcp-host-Reservierungen (hosts.conf) außerhalb dieses Bereichs
# funktionieren trotzdem, solange sie im selben /22 liegen.
dhcp-range=10.0.2.10,10.0.2.250,255.255.252.0,12h
dhcp-option=option:router,10.0.0.1
dhcp-option=option:dns-server,10.0.0.1
dhcp-authoritative
+5 -2
View File
@@ -16,7 +16,10 @@ iface enp3s0 inet static
dns-nameservers 141.14.128.1
dns-search fhi.mpg.de
# LAN interface (Router/Gateway/DHCP/DNS für 10.0.0.0/24)
# LAN interface (Router/Gateway/DHCP/DNS für 10.0.0.0/22)
# Aufteilung: 10.0.0.0/24 statisch, 10.0.1.0/24 DHCP-Reservierungen (MAC),
# 10.0.2.0/24 dynamischer DHCP-Pool, 10.0.3.0/24 Reserve/unbenutzt.
# Details: siehe README.md im Router-Repo.
allow-hotplug enp7s0
iface enp7s0 inet static
address 10.0.0.1/24
address 10.0.0.1/22
+1 -1
View File
@@ -17,7 +17,7 @@ table inet filter {
table inet nat {
chain postrouting {
type nat hook postrouting priority srcnat;
ip saddr 10.0.0.0/24 oifname "enp3s0" masquerade
ip saddr 10.0.0.0/22 oifname "enp3s0" masquerade
}
}