Repository navigation
fix(packer): drop tpl-kali's build-time eth0 DHCP stanza before templating (#790) - #1341
Merged
Merged
Conversation
…ating (#790) The preseed writes /etc/network/interfaces.d/eth0 so the build has a network. Left in the template, ifupdown raised it beside cloud-init's static stanza on a static-only clone; with no DHCP server dhcpcd fell back to 169.254.x.x and added a link-local default route, failing build-the-playground.md section 8 check four on gandalf. The first provisioner now removes it beside cloud-init clean, for 902 and 910. Every clone gets a NoCloud drive, and every caller sets ipconfig0, so DHCP clones still bring eth0 up through cloud-init. Neither template is rebuilt yet; that runs from phoenix. Refs #790. Refs #421. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
force-pushed
the
gerrrt/kali-no-eth0-dhcp
branch
from
November 9, 2026 20:51
a3b8893 to
6afbd56
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Operator verification is still needed on rebuilt templates 902 and 910 to confirm DHCP first boots work and a static-only vmbr1 clone has no default route, since source inspection cannot establish these runtime properties.
No open issues 🎉
What changed in this PR
This PR removes Kali’s build-time DHCP configuration before templating, preventing it from conflicting with cloud-init networking and creating an unwanted default route on static-only range clones.
Changes:
- Deletes
/etc/network/interfaces.d/eth0during Packer provisioning while retaining it for the installation build. - Documents the cause and required rebuilds for templates 902 and 910. Rebuilds and live verification remain pending.
| File | Description |
|---|---|
packer/kali/preseed.cfg.pkrtpl |
Clarifies in comments that the DHCP stanza is build-only. |
packer/kali.pkr.hcl |
Removes the DHCP stanza before templating. |
docs/runbooks/build-the-lab-templates.md |
Explains the network conflict and required template rebuilds. |
docs/changelog.md |
Records the fix and pending rebuild status. |
Review effort: Balanced
Gerrrt
enabled auto-merge (squash)
November 9, 2026 20:51
# Conflicts: # docs/changelog.md
The rebase and merge resolutions kept diff3 base blocks in the 2026-11-09 section. The changelog is now main's plus this PR's one entry. Refs #790. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
packer/kali.pkr.hcl's first provisioner now runsrm -f /etc/network/interfaces.d/eth0besidecloud-init clean, sotpl-kali(902) andtpl-kali-saruman(910) no longer ship the preseed'sbuild-time eth0 DHCP stanza. The preseed still writes it, because the build
needs it. Its comment now says the build removes it before templating.
Why
On
gandalf, a throwaway static-only clone of 902 at172.30.30.199onvmbr1raised both that stanza and cloud-init's static50-cloud-initstanza. With no DHCP server, dhcpcd fell back to
169.254.x.xand addeddefault dev eth0 scope link. That failedbuild-the-playground.md§8 checkfour: a range target must have no default route (ADR-0014/0017).
The installer's
ens18stanza in/etc/network/interfacesstays. Kali namesthe NIC
eth0(99-default.link→/dev/null), so noens18exists andifupdown never raises it.
Refs #790.
Refs #421.
Blast radius
tpl-kaliandtpl-kali-saruman, once rebuilt, and future clones of them.A clone's network now comes only from cloud-init's
ipconfigN. Every currentcaller sets
ipconfig0=ip=dhcp:scripts/packer-smoke.sh,scripts/make-attack-vm.sh(ragnarok's eth0) andgaruda's tofu module.So their eth0 still comes up. A clone made with no
ipconfig0relies oncloud-init's own fallback.
secrets/*.sops.yamlVerification
make validatepasses: all checks passed, with 43 skipped and not run.This host has no docker and no packer, so
packer validate, shellcheck,markdownlint, yamllint, ruff, actionlint, promtool/amtool/loki/alloy and the
Caddyfile checks were skipped. CI runs them.
902 on
gandalf(build-the-lab-templates.md§5) and 910 onSaruman(§5b) runs from
phoenixand is the operator's step. After that, runpacker-smoke.shfor each, plus a static clone onvmbr1through §8check four.
docs/changelog.md,docs/runbooks/build-the-lab-templates.md§5.🤖 Generated with Claude Code