Make router IP address configurable via deploy.conf

Add GATEWAY_IP, GATEWAY_PREFIX, GATEWAY_NETWORK, DHCP_RANGE_START, and
DHCP_RANGE_END variables to deploy.conf. Update ap/21-van-br0.network,
ap/van-ap-dnsmasq.conf, and ap/nftables.conf to use @TOKEN@ placeholders
for IP configuration instead of hardcoding 10.42.x addresses.

This allows deploying the same configuration to multiple routers on
different networks (e.g., Pi 5 on 10.42.0.x and R5C on 10.42.1.x) by
simply editing deploy.conf before running ./deploy.sh.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-18 17:31:18 -04:00
co-authored by Claude Haiku 4.5
parent ec5130ea7d
commit ad199fb0b0
5 changed files with 44 additions and 23 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
# The LAN gateway IP now lives on the bridge, not on the AP wlan (which is just a
# bridge member). ConfigureWithoutCarrier keeps 10.42.0.1 up even before any wired
# bridge member). ConfigureWithoutCarrier keeps 10.42.1.1 up even before any wired
# device is plugged, exactly as it was on the wlan-only setup.
[Match]
Name=br0
@@ -8,7 +8,7 @@ Name=br0
RequiredForOnline=no
[Network]
Address=10.42.0.1/24
Address=@GATEWAY_IP@/@GATEWAY_PREFIX@
ConfigureWithoutCarrier=yes
# Resolve .local (mDNS) for devices on the van's own LAN (ESPHome nodes,
# etc.) — scoped to br0 only, not the WAN links, since mDNS is link-local
+1 -1
View File
@@ -6,6 +6,6 @@ delete table ip van_router_nat
table ip van_router_nat {
chain postrouting {
type nat hook postrouting priority srcnat; policy accept;
ip saddr 10.42.0.0/24 oifname != "br0" masquerade
ip saddr @GATEWAY_NETWORK@ oifname != "br0" masquerade
}
}
+4 -4
View File
@@ -4,9 +4,9 @@ except-interface=lo
domain-needed
bogus-priv
dhcp-authoritative
dhcp-range=10.42.0.10,10.42.0.254,255.255.255.0,12h
dhcp-range=@DHCP_RANGE_START@,@DHCP_RANGE_END@,255.255.255.0,12h
# Home Assistant runs natively on this host (Podman, host network, :8123) —
# "homeassistant" is just another name for the router address.
host-record=homeassistant,10.42.0.1
dhcp-option=option:router,10.42.0.1
dhcp-option=option:dns-server,10.42.0.1
host-record=homeassistant,@GATEWAY_IP@
dhcp-option=option:router,@GATEWAY_IP@
dhcp-option=option:dns-server,@GATEWAY_IP@