founding connect: a home machine behind a router FAILS "Visitors can reach it" as CGNAT — the check probes the box's private NIC address, and the same address would be wired to the community's name #1585

Closed
opened 2026-09-18 15:56:40 +00:00 by ben · 4 comments
Owner

What is wrong

A machine at your place, dialled IN on founding's Connect section, is probed for "Visitors can reach it" against its own network-card address, not the public address of the line it sits on. Behind a household router that address is private (192.168.x.x), the prober refuses every non-public address as the CGNAT lane before dialling, the check fails, and Continue is blocked. Every ordinary home machine — the exact case DDR 0240's dial-in door exists for — is told it is behind CGNAT when it is not.

Found by code review (2026-09-18 founding device-check review), not yet reproduced live: nothing in the suite or the drives exercises a NATed box.

The chain

  1. internal/hostprobe/prober.go:178 — Prober.Network reads the default-route interface's own address. On a home LAN that is the RFC 1918 address. enroll.NetworkFacts.Address is commented "public IP in CIDR form" — true on a cloud box, false behind a router.
  2. internal/founding/connectcheck.go:236 — AwaitDialIn takes stripCIDR(view.Network.Address) as the device's netAddr.
  3. internal/founding/connectcheck.go:285 — CheckDevice hands that to o.reach.Probe.
  4. internal/reachability/prober.go:156 — !isPublicRoutable(parsed) (ip.IsPrivate()) → Reachable:false, the CGNAT guidance → CheckFail → passed=false.

The same read feeds the rest of the self-hosted public path: knownGatewayIP (internal/founding/standup.go:1176) resolves st.GatewayIP from view.Network, and st.GatewayIP is what RunReachability probes (standup.go:873) and what wireName points the community's name at (standup.go:886). A home gateway would have its name wired to a private address.

When no Network facts were captured (a VM/LAN join), netAddr is empty and the check falls to a warn ("Couldn't check inbound reachability") — so the step passes without having tested anything. Both outcomes are wrong in opposite directions.

What was lost

The pre-check this replaced (internal/dns/resolver.go:119, DDR 0139) learned the line's real public-facing address by the OpenDNS reflection query (dns.PublicIP), which is NAT-correct. It measured the wrong machine (the app's line — #326), so DDR 0240 moved the check onto the device — but the move dropped the public-address discovery. The address heartbeat (ADR 0136, #330) already reuses dns.PublicIP to observe a gateway's address from behind NAT, so the read exists and is proven.

Why nothing caught it

  • internal/founding/connectcheck_test.go:218 scripts the dial-in probe with 198.51.100.7/24 — a public address.
  • The --target selfhosted drive box (#1450 leg 10) is a DigitalOcean droplet whose NIC carries its public address.
  • #1450's cgnat-blocks leg simulates the failure with a cloud firewall, not a router.

Acceptance criteria

  1. A dial-in machine reports its line's public-facing address as a fact of its own — read ON the machine (DDR 0240 decision 4: the machine's line, not the app's), distinct from the NIC address the takeover's networkd config needs. NetworkFacts.Address keeps its takeover meaning; its "public IP" comment is corrected.
  2. CheckDevice probes the public-facing address. A machine on 192.168.x.x behind a router with a public WAN address no longer fails the CGNAT lane.
  3. A machine whose public-facing address IS in 100.64.0.0/10 still fails, with the CGNAT wording — the one blocking case stands (ADR 0026).
  4. knownGatewayIP prefers the public-facing address for the S10 probe and for wireName; a private address is never wired to a community's name (fail loud, ADR 0100).
  5. A discovery failure is an honest warn ("couldn't learn this machine's public address"), never a fabricated pass and never the CGNAT verdict.
  6. Tests: a dial-in probe scripted with an RFC 1918 NIC address + a public reflected address passes; the same with a 100.64/10 reflected address fails CGNAT; knownGatewayIP table gains the NATed row.
  • The probe still dials from the operator's own computer — see the vantage ticket filed alongside this one; this ticket fixes WHICH address is probed, that one fixes WHERE FROM.
  • #331 (deferred) — the port walkthrough / automatic port opening. Not reopened by this: this is a defect in a shipped check, not the walkthrough.
  • #1450 — the live drive has no NATed leg.
## What is wrong A machine at your place, dialled IN on founding's Connect section, is probed for "Visitors can reach it" against **its own network-card address**, not the public address of the line it sits on. Behind a household router that address is private (`192.168.x.x`), the prober refuses every non-public address as the CGNAT lane *before dialling*, the check **fails**, and Continue is blocked. Every ordinary home machine — the exact case DDR 0240's dial-in door exists for — is told it is behind CGNAT when it is not. Found by code review (2026-09-18 founding device-check review), not yet reproduced live: nothing in the suite or the drives exercises a NATed box. ## The chain 1. `internal/hostprobe/prober.go:178` — `Prober.Network` reads the default-route interface's own address. On a home LAN that is the RFC 1918 address. `enroll.NetworkFacts.Address` is commented "public IP in CIDR form" — true on a cloud box, false behind a router. 2. `internal/founding/connectcheck.go:236` — `AwaitDialIn` takes `stripCIDR(view.Network.Address)` as the device's `netAddr`. 3. `internal/founding/connectcheck.go:285` — `CheckDevice` hands that to `o.reach.Probe`. 4. `internal/reachability/prober.go:156` — `!isPublicRoutable(parsed)` (`ip.IsPrivate()`) → `Reachable:false`, the CGNAT guidance → `CheckFail` → `passed=false`. The **same read** feeds the rest of the self-hosted public path: `knownGatewayIP` (`internal/founding/standup.go:1176`) resolves `st.GatewayIP` from `view.Network`, and `st.GatewayIP` is what `RunReachability` probes (`standup.go:873`) **and what `wireName` points the community's name at** (`standup.go:886`). A home gateway would have its name wired to a private address. When no Network facts were captured (a VM/LAN join), `netAddr` is empty and the check falls to a **warn** ("Couldn't check inbound reachability") — so the step passes without having tested anything. Both outcomes are wrong in opposite directions. ## What was lost The pre-check this replaced (`internal/dns/resolver.go:119`, DDR 0139) learned the line's real **public-facing** address by the OpenDNS reflection query (`dns.PublicIP`), which is NAT-correct. It measured the wrong machine (the app's line — #326), so DDR 0240 moved the check onto the device — but the move dropped the public-address discovery. The address heartbeat (ADR 0136, #330) already reuses `dns.PublicIP` to observe a gateway's address from behind NAT, so the read exists and is proven. ## Why nothing caught it - `internal/founding/connectcheck_test.go:218` scripts the dial-in probe with `198.51.100.7/24` — a public address. - The `--target selfhosted` drive box (#1450 leg 10) is a DigitalOcean droplet whose NIC carries its public address. - #1450's `cgnat-blocks` leg simulates the failure with a cloud firewall, not a router. ## Acceptance criteria 1. A dial-in machine reports its line's **public-facing address** as a fact of its own — read ON the machine (DDR 0240 decision 4: the machine's line, not the app's), distinct from the NIC address the takeover's networkd config needs. `NetworkFacts.Address` keeps its takeover meaning; its "public IP" comment is corrected. 2. `CheckDevice` probes the public-facing address. A machine on `192.168.x.x` behind a router with a public WAN address no longer fails the CGNAT lane. 3. A machine whose public-facing address IS in `100.64.0.0/10` still fails, with the CGNAT wording — the one blocking case stands (ADR 0026). 4. `knownGatewayIP` prefers the public-facing address for the S10 probe and for `wireName`; a private address is never wired to a community's name (fail loud, ADR 0100). 5. A discovery failure is an honest warn ("couldn't learn this machine's public address"), never a fabricated pass and never the CGNAT verdict. 6. Tests: a dial-in probe scripted with an RFC 1918 NIC address + a public reflected address passes; the same with a `100.64/10` reflected address fails CGNAT; `knownGatewayIP` table gains the NATed row. ## Related - The probe still dials from the operator's own computer — see the vantage ticket filed alongside this one; this ticket fixes WHICH address is probed, that one fixes WHERE FROM. - #331 (deferred) — the port walkthrough / automatic port opening. Not reopened by this: this is a defect in a shipped check, not the walkthrough. - #1450 — the live drive has no NATed leg.
Author
Owner

Siblings from the same review (2026-09-18): #1587 is the vantage ticket referred to above (WHERE the probe dials from); #1586 takes the visitors check off helpers entirely. This one is independent of both and can land first.

Siblings from the same review (2026-09-18): #1587 is the vantage ticket referred to above (WHERE the probe dials from); #1586 takes the visitors check off helpers entirely. This one is independent of both and can land first.

swarm-claim host=bens-mac-04 run=26656
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=26656 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1585 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1585,
  "status": "success",
  "commits": [
    "55864dab21a0967541a3aac1a69b16cfa0a3b64c"
  ],
  "changed_files": [
    "STATUS.md",
    "agent/cmd/agent/wiring_prod.go",
    "dashboard/src/lib/api/generated.ts",
    "internal/dns/resolver.go",
    "internal/enroll/enroll.go",
    "internal/founding/connectcheck.go",
    "internal/founding/connectcheck_test.go",
    "internal/founding/deploy_test.go",
    "internal/founding/handoff_test.go",
    "internal/founding/knowngatewayip_internal_test.go",
    "internal/founding/manualpath_test.go",
    "internal/founding/seed_test.go",
    "internal/founding/selfhostedcarrier_test.go",
    "internal/founding/selfhostedpath_test.go",
    "internal/founding/standup.go",
    "internal/founding/standup_test.go",
    "internal/hostprobe/prober.go",
    "internal/hostprobe/prober_test.go",
    "internal/publicip/publicip.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/hostprobe/ ./internal/publicip/ ./internal/dns/ ./internal/founding/ ./internal/enroll/ ./agent/cmd/agent/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/founding/ ./internal/hostprobe/ ./internal/dns/ ./internal/publicip/ ./internal/enroll/ ./internal/enrollwire/ ./internal/join/ ./internal/reachability/",
      "exit_code": 0
    },
    {
      "command": "node packages/openapi-spec/scripts/generate-client.mjs --check",
      "exit_code": 0
    }
  ],
  "criteria": {
    "AC1 dial-in machine reports its line's public-facing address, read ON the machine, distinct from the NIC address; Address keeps takeover meaning, its public-IP comment corrected": "internal/enroll/enroll.go (NetworkFacts.PublicAddress added, Address comment corrected); internal/publicip/publicip.go (Lookup, OpenDNS reflection); internal/hostprobe/prober.go (Network sets PublicAddress via WithPublicAddress source); agent/cmd/agent/wiring_prod.go wires publicip.Lookup; packages/openapi-spec/openapi.yaml + generated.ts",
    "AC2 CheckDevice probes the public-facing address; a 192.168.x.x box behind a public-WAN router no longer fails CGNAT": "internal/founding/connectcheck.go (AwaitDialIn carries stripCIDR(view.Network.PublicAddress)); TestHandle_CheckDevice_DialInProbesLinePublicAddressNotPrivateNIC",
    "AC3 a machine whose public address IS in 100.64.0.0/10 still fails with CGNAT wording": "TestHandle_CheckDevice_DialInCGNATPublicAddressStillFailsCGNAT (real reachability prober); internal/reachability/prober.go isPublicRoutable unchanged",
    "AC4 knownGatewayIP prefers the public-facing address for S10 probe and wireName; a private address is never wired to a community's name": "internal/founding/standup.go (knownGatewayIP reads n.PublicAddress, private NIC never returned); internal/founding/knowngatewayip_internal_test.go table (NATed row + private-never-wired row)",
    "AC5 a discovery failure is an honest warn, never a fabricated pass and never the CGNAT verdict": "internal/founding/connectcheck.go warn wording 'Couldn't learn this machine's public address'; internal/hostprobe/prober.go publicAddress honest-empty on nil/err; TestHandle_CheckDevice_DialInNoPublicAddressWarnsNotCGNAT; TestNetwork_NoPublicAddressSourceIsHonestEmpty; TestNetwork_PublicAddressReadFaultIsHonestEmpty",
    "AC6 tests: RFC1918 NIC + public reflected passes; same with 100.64/10 reflected fails CGNAT; knownGatewayIP table gains the NATed row": "internal/founding/connectcheck_test.go (3 dial-in cases); internal/founding/knowngatewayip_internal_test.go (NATed row); internal/hostprobe/prober_test.go (3 cases)"
  },
  "summary": "Founding's visitors check and knownGatewayIP now use the machine's line public-facing address (OpenDNS reflection, read on the box) instead of its private NIC address, so home boxes behind a router stop being mislabelled CGNAT.",
  "blockers": []
}
**close-report** for #1585 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1585, "status": "success", "commits": [ "55864dab21a0967541a3aac1a69b16cfa0a3b64c" ], "changed_files": [ "STATUS.md", "agent/cmd/agent/wiring_prod.go", "dashboard/src/lib/api/generated.ts", "internal/dns/resolver.go", "internal/enroll/enroll.go", "internal/founding/connectcheck.go", "internal/founding/connectcheck_test.go", "internal/founding/deploy_test.go", "internal/founding/handoff_test.go", "internal/founding/knowngatewayip_internal_test.go", "internal/founding/manualpath_test.go", "internal/founding/seed_test.go", "internal/founding/selfhostedcarrier_test.go", "internal/founding/selfhostedpath_test.go", "internal/founding/standup.go", "internal/founding/standup_test.go", "internal/hostprobe/prober.go", "internal/hostprobe/prober_test.go", "internal/publicip/publicip.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/hostprobe/ ./internal/publicip/ ./internal/dns/ ./internal/founding/ ./internal/enroll/ ./agent/cmd/agent/", "exit_code": 0 }, { "command": "go test ./internal/founding/ ./internal/hostprobe/ ./internal/dns/ ./internal/publicip/ ./internal/enroll/ ./internal/enrollwire/ ./internal/join/ ./internal/reachability/", "exit_code": 0 }, { "command": "node packages/openapi-spec/scripts/generate-client.mjs --check", "exit_code": 0 } ], "criteria": { "AC1 dial-in machine reports its line's public-facing address, read ON the machine, distinct from the NIC address; Address keeps takeover meaning, its public-IP comment corrected": "internal/enroll/enroll.go (NetworkFacts.PublicAddress added, Address comment corrected); internal/publicip/publicip.go (Lookup, OpenDNS reflection); internal/hostprobe/prober.go (Network sets PublicAddress via WithPublicAddress source); agent/cmd/agent/wiring_prod.go wires publicip.Lookup; packages/openapi-spec/openapi.yaml + generated.ts", "AC2 CheckDevice probes the public-facing address; a 192.168.x.x box behind a public-WAN router no longer fails CGNAT": "internal/founding/connectcheck.go (AwaitDialIn carries stripCIDR(view.Network.PublicAddress)); TestHandle_CheckDevice_DialInProbesLinePublicAddressNotPrivateNIC", "AC3 a machine whose public address IS in 100.64.0.0/10 still fails with CGNAT wording": "TestHandle_CheckDevice_DialInCGNATPublicAddressStillFailsCGNAT (real reachability prober); internal/reachability/prober.go isPublicRoutable unchanged", "AC4 knownGatewayIP prefers the public-facing address for S10 probe and wireName; a private address is never wired to a community's name": "internal/founding/standup.go (knownGatewayIP reads n.PublicAddress, private NIC never returned); internal/founding/knowngatewayip_internal_test.go table (NATed row + private-never-wired row)", "AC5 a discovery failure is an honest warn, never a fabricated pass and never the CGNAT verdict": "internal/founding/connectcheck.go warn wording 'Couldn't learn this machine's public address'; internal/hostprobe/prober.go publicAddress honest-empty on nil/err; TestHandle_CheckDevice_DialInNoPublicAddressWarnsNotCGNAT; TestNetwork_NoPublicAddressSourceIsHonestEmpty; TestNetwork_PublicAddressReadFaultIsHonestEmpty", "AC6 tests: RFC1918 NIC + public reflected passes; same with 100.64/10 reflected fails CGNAT; knownGatewayIP table gains the NATed row": "internal/founding/connectcheck_test.go (3 dial-in cases); internal/founding/knowngatewayip_internal_test.go (NATed row); internal/hostprobe/prober_test.go (3 cases)" }, "summary": "Founding's visitors check and knownGatewayIP now use the machine's line public-facing address (OpenDNS reflection, read on the box) instead of its private NIC address, so home boxes behind a router stop being mislabelled CGNAT.", "blockers": [] } ``` </details>
Author
Owner

Correction from real hardware — AC3 cannot be met as written: a reflected address NEVER shows CGNAT (2026-09-18)

Read-only probe of elitebook-03 (Starlink, a known CGNAT line):

Fact Value
NIC address 192.168.1.122/24
Path hop 2 (tracepath) 100.64.0.1 — carrier-grade NAT, confirmed
OpenDNS-reflected address (myip.opendns.com) 179.65.135.74 — a PUBLIC address

The reflection returns the carrier's public egress address, not the router's WAN-side address. It is therefore never in 100.64.0.0/10, on any CGNAT line. So:

  • AC3 above is unachievable ("a machine whose public-facing address IS in 100.64/10 still fails") — that input does not occur in the world.
  • The retired pre-check (internal/dns/resolver.go:119, DDR 0139) had the same hole all along: on this Starlink line it would have answered "Your connection has a public address that can accept visitors." Its CGNAT branch is dead code in practice, and its unit test passes only because the test hands it a 100.64 address directly.

What can honestly detect CGNAT:

  1. The outside-in dial-back (#1587, ruled 2026-09-18) — the broker dials the request's source address; under CGNAT nothing the operator forwards can ever make it answer. This is the real test, and it needs the port board (#1588) to distinguish "not forwarded yet" from "can never work".
  2. A path hint, as advice only — a 100.64.0.0/10 hop on the machine's own outbound path (as above), or the router's external address over UPnP/NAT-PMP differing from the reflected one. Cheap, local, and lets the screen say "this looks like CGNAT" before the operator spends an evening in their router. Warn-grade (ADR 0015), never the verdict.

Amended AC3: the reflected address is recorded as the machine's public-facing address and is what gets probed; CGNAT is NOT inferred from it. A 100.64/10 hop on the machine's outbound path raises a CGNAT warn naming what was seen. The blocking CGNAT verdict belongs to the outside-in probe (#1587 + #1588).

elitebook-03 is a standing real-world fixture for exactly this — see the hardware-drive note on #1450.

## Correction from real hardware — AC3 cannot be met as written: a reflected address NEVER shows CGNAT (2026-09-18) Read-only probe of `elitebook-03` (Starlink, a known CGNAT line): | Fact | Value | |---|---| | NIC address | `192.168.1.122/24` | | Path hop 2 (`tracepath`) | **`100.64.0.1`** — carrier-grade NAT, confirmed | | OpenDNS-reflected address (`myip.opendns.com`) | **`179.65.135.74`** — a PUBLIC address | The reflection returns the carrier's public **egress** address, not the router's WAN-side address. It is therefore never in `100.64.0.0/10`, on any CGNAT line. So: - **AC3 above is unachievable** ("a machine whose public-facing address IS in 100.64/10 still fails") — that input does not occur in the world. - The retired pre-check (`internal/dns/resolver.go:119`, DDR 0139) had the same hole all along: on this Starlink line it would have answered *"Your connection has a public address that can accept visitors."* Its CGNAT branch is dead code in practice, and its unit test passes only because the test hands it a `100.64` address directly. **What can honestly detect CGNAT:** 1. **The outside-in dial-back (#1587, ruled 2026-09-18)** — the broker dials the request's source address; under CGNAT nothing the operator forwards can ever make it answer. This is the real test, and it needs the port board (#1588) to distinguish "not forwarded yet" from "can never work". 2. **A path hint, as advice only** — a `100.64.0.0/10` hop on the machine's own outbound path (as above), or the router's external address over UPnP/NAT-PMP differing from the reflected one. Cheap, local, and lets the screen say "this looks like CGNAT" *before* the operator spends an evening in their router. Warn-grade (ADR 0015), never the verdict. **Amended AC3:** the reflected address is recorded as the machine's public-facing address and is what gets probed; CGNAT is NOT inferred from it. A `100.64/10` hop on the machine's outbound path raises a CGNAT **warn** naming what was seen. The blocking CGNAT verdict belongs to the outside-in probe (#1587 + #1588). `elitebook-03` is a standing real-world fixture for exactly this — see the hardware-drive note on #1450.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1585
No description provided.