diff options
| author | tv <tv@krebsco.de> | 2026-11-16 20:03:59 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-16 21:29:03 +0100 |
| commit | 47956fe278d0e169e5ecbee442303737ea7226f1 (patch) | |
| tree | e5d2992cb62c2b73ed6a66a52bc8e9075b03711b | |
| parent | 9a6f2a20edd0c76a8fd3b58280d038a0aa3eec12 (diff) | |
host: make sure nginx gets to bind to 172.16.0.1
With networkd, fcbr0 only got its address while it had carrier, i.e.
while a VM was running, so nginx failed with "bind() to 172.16.0.1:443
failed (99: Cannot assign requested address)" and gave up after a few
restarts. Configure fcbr0 without carrier, and let nginx retry without
start limit until the address is there.
| -rw-r--r-- | host.nix | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -147,6 +147,10 @@ in { fcbr0.ipv4.addresses = [{ address = "172.16.0.1"; prefixLength = 24; }]; }; networking.bridges.fcbr0.interfaces = tapNames; + # With networkd, fcbr0 would only get its address while it has carrier, + # i.e. while a VM runs, so nginx couldn't bind to it before. (Unused + # with scripted networking, which assigns it regardless.) + systemd.network.networks."40-fcbr0".networkConfig.ConfigureWithoutCarrier = true; # Only rejects; for anything else the host's own forward chain decides. networking.nftables.enable = true; @@ -197,11 +201,13 @@ in { ]; # nginx binds to 172.16.0.1, so it has to wait for fcbr0's address - # (network-addresses-fcbr0.service with scripted networking; else - # Restart= gets it there). On reload, sniConfig regenerates the map and + # (network-addresses-fcbr0.service with scripted networking; with + # networkd, nothing to order after, so it keeps restarting, without start + # limit, until the address is there). On reload, sniConfig regenerates the map and # nginx re-reads its config on SIGHUP; if that fails, it keeps the old. systemd.services.fcbr0-sni = { wantedBy = [ "multi-user.target" ]; + startLimitIntervalSec = 0; after = [ "network.target" "network-addresses-fcbr0.service" "systemd-tmpfiles-setup.service" ]; serviceConfig = { ExecStartPre = sniConfig; |
