Repository navigation
Conversation
…t online The sandbox's only IPv4 address is the link-local 169.254.0.21/30 from the kernel's ip= argument, and software that requires a non-link-local address to consider the host online reads the guest as having no network at all. The reported case is Tailscale: its network monitor does not count 169.254.0.0/16 as usable, so tailscaled pauses its control client before login and auth keys never reach the control plane — while plain egress (curl to the control plane itself) works fine. Add the RFC 7600 IPv4 dummy address 192.0.0.8/32 to eth0 when envd starts in a Firecracker guest. RFC 7600 reserves that address for hosts with no other usable IPv4 address and it is never routed, so it cannot clash with user networks or VPN ranges the way RFC 1918 or Tailscale's own 100.64.0.0/10 would. It is added with IFA_F_NOPREFIXROUTE, so no prefix route is created: egress keeps selecting 169.254.0.21 as its source and nothing routes to the dummy address, leaving inbound traffic unchanged. The request is built and sent over NETLINK_ROUTE directly rather than by running `ip addr`, because some base images ship no iproute2 and envd (unlike the orchestrator) has no netlink library dependency — golang.org/x/sys/unix is already one. Adding is idempotent, which covers both lifecycle paths: a cold boot runs envd again and ignores EEXIST, while a memory-snapshot resume keeps the address because it lives in kernel state. A failure only warns, since egress does not depend on it. Fixes e2b-dev#3780
tunsuy
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
November 17, 2026 10:18
This branch has not been deployed
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.
Fixes #3780
Problem
A sandbox's only IPv4 address is the link-local
169.254.0.21/30configured by the kernel'sip=argument. Software that requires a non-link-local address to consider the host online therefore treats the guest as having no network at all. The reported case is Tailscale: its network monitor does not count169.254.0.0/16as usable, sotailscaledpauses its control client before login — auth keys silently never reach the control plane, even though outbound connectivity is fine (curlto the control plane returns 200 from the same guest).Change
As proposed in #3780: when envd starts in a Firecracker guest (
!isNotFC), add the RFC 7600 IPv4 dummy address192.0.0.8/32toeth0withIFA_F_NOPREFIXROUTE.192.0.0.8: RFC 7600 reserves it for exactly this situation (a host with no other usable IPv4 address) and it is never routed, so — unlike100.64.0.0/10(Tailscale's own CGNAT range) or RFC 1918 ranges — it cannot clash with user networks or VPNs.noprefixroute: no prefix route is created, so egress keeps selecting169.254.0.21as its source and nothing routes to the dummy address: no inbound effect, no routing change.host.PinMMDSRoute). Theip=kernel argument only configures one address, so the orchestrator cannot add a second one.vishvananda/netlinklibrary orip addr: some base images ship no iproute2, and envd (unlike the orchestrator) deliberately has no netlink dependency —golang.org/x/sys/unixis already one, and envd already talks to a netlink socket directly (the uevent watcher ininternal/services/memlimit/events_linux.go). TheRTM_NEWADDRrequest is built to the same wire formatip addr add … noprefixrouteproduces (NOPREFIXROUTErides inIFA_FLAGS, since it does not fit the legacy 8-bit field), with zero new dependencies and nogo.mod/go.sumchurn.EEXIST; a memory-snapshot resume keeps the address because it lives in kernel state. A failure only logs a warning; startup never blocks on it.Tests
TestBuildAddrMsgEncodesNoPrefixRoutedecodes the built request and asserts the wire format:IFA_LOCAL/IFA_ADDRESS= the dummy address,IFA_FLAGS=NOPREFIXROUTE, noIFA_BROADCAST(a/32must not get one), legacy flags field zero.TestEnsureRoutableAddrRoundTripexercises the real netlink path (root-gated, skipped otherwise): add → verify via a netlink dump → re-add hits theEEXISTbranch → delete → verify gone.TestEnsureRoutableAddrRejectsBadInputcovers bad CIDR, missing link, and IPv6 input.TestNlaPadpins the attribute alignment arithmetic.packages/envd/internal/hostpackage passes on linux/amd64;go build/go vetclean for linux, and the!linuxstub keeps darwin builds working.Manual verification (Docker, privileged alpine)
Running
EnsureRoutableAddragainst the container'seth0reproduces the issue's verified workaround state exactly:Notes
hostname -I) will additionally list192.0.0.8; tools using the default route's source address keep seeing the link-local one.internal/host, and an 11-line hook inmain.go.