- systemd-networkd(/usr/lib 80-container-ve.network,匹配 ve-*) 会在 veth 建好后几秒内刷掉静态 10.200.0.1、改 DHCP/链路本地, 致单元网关不可达、TCP/UDP 全灭(FORWARD/NAT 计数器恒 0; 早先一次 curl 403 是刷掉前的窗口期偶发)。修法:镜像内置 /etc/systemd/network/79-chv-cell.network(Unmanaged=yes), 须排在 80 之前(99 会被 80 抢走,已实测);build.sh copy-in + 校验、BASE_CONTENTS 与两处 DECLARED_SOURCES 登记。 - run_cell 配网后复核 ve 上确有 10.200.0.1(_iface_has_ip), 不见即大声失败、不跑无网单元(第二道防线)。 - 单元内 DNS:/etc/resolv.conf 是 127.0.0.53 stub,单元独立 netns 里自己的 lo 上没有 resolver;把上游 /run/systemd/resolve/resolv.conf 绑到 /etc/resolv.conf (解析 symlink 后挂真实目标)。live 验证:DNS-UDP-OK、 getaddrinfo 解析成功、curl https://gitea.tose.top 200。 - 单测:CellResolvTest + _iface_has_ip 真实 lo 断言 + 规约 dns_resolv_conf 字段;P2 + 阶段 2 共 74 项全过。
13 lines
625 B
SYSTEMD
13 lines
625 B
SYSTEMD
# NOTE: must sort before /usr/lib/systemd/network/80-container-ve.network (systemd built-in container-veth config, matches ve-*), otherwise that file wins and networkd DHCPs the interface.
|
|
# chv-cell veth: managed entirely by chv-cell (static 10.200.0.1/24 + NAT).
|
|
# systemd-networkd must not touch it: it would DHCP/link-local the
|
|
# interface and flush the static address, breaking all cell networking
|
|
# (2026-11-07 live diagnosis: 10.200.0.1 vanished within seconds of
|
|
# the veth being created, cell gateway unreachable, FORWARD/NAT
|
|
# counters stayed 0 for both TCP and UDP).
|
|
[Match]
|
|
Name=ve-chv-cell
|
|
|
|
[Link]
|
|
Unmanaged=yes
|