stellio: drop IPv6 workarounds now upstream in cnx-network
Both interim blocks are in cnx-network b2b5daa: - 27c697a adds vlans.<name>.ipv6SubnetId (lan -> 0, others -> VLAN id), replacing the SubnetId=auto race the mkForce pins worked around. mgmt moves from 0x1 to 0xA; on AIS's bare /64 both are skipped alike. - 45643d6 is the router-radv-deprecate unit this file carried a copy of. Keeping both concatenated the two scripts into one unit running two ip-monitor loops.
This commit is contained in:
1 parent
bb3bdc9e2b
commit
e66589a654
1 file changed
-91
@@ -84,97 +84,6 @@
|
||||
22
|
||||
];
|
||||
|
||||
# AIS delegates a single /64 over PPPoE (seen 2026-10-02: "ppp0: DHCP:
|
||||
# received delegated prefix 2405:9800:b910:1f5d::/64"). The router
|
||||
# service hands out sub-prefixes with SubnetId=auto, so whichever VLAN
|
||||
# interface comes up first takes the whole /64 -- on this box vlan-mgmt
|
||||
# did, and vlan-lan logged "Couldn't find a suitable prefix. Ran out of
|
||||
# address space": no RA prefix on lan, so clients had no global IPv6.
|
||||
# Pin the ids: lan (where the clients are) always gets subnet 0, i.e.
|
||||
# the entire prefix when it is a /64; mgmt asks for subnet 1, which
|
||||
# fails harmlessly on a /64 (mgmt is reached over v4 and the meshes) and
|
||||
# starts working unchanged if AIS ever delegates wider. Drop once
|
||||
# cnx-network's router service exposes a per-VLAN subnet id.
|
||||
systemd.network.networks."40-vlan-lan".dhcpPrefixDelegationConfig.SubnetId = lib.mkForce "0x0";
|
||||
systemd.network.networks."40-vlan-mgmt".dhcpPrefixDelegationConfig.SubnetId = lib.mkForce "0x1";
|
||||
|
||||
# Interim copy of cnx-network-clan 45643d6 (router/ipv6: deprecate
|
||||
# withdrawn DHCPv6-PD prefixes); drop when the input is bumped past it.
|
||||
# networkd never deprecates a prefix it stops announcing (systemd#29651):
|
||||
# on every reboot the first PPPoE session lands on another AIS BNG, is
|
||||
# torn down minutes later, and the reconnect brings a different /64.
|
||||
# networkd announces the new prefix at once but clients keep the old
|
||||
# one preferred for the rest of its 1800 s lifetime, so RFC 6724 source
|
||||
# selection picks the dead prefix and every v6 connection fails for up
|
||||
# to 30 minutes (2026-10-08 07:57). Watch vlan-* for networkd removing a
|
||||
# dynamic (PD) address and send up to three RAs with that /64 at
|
||||
# preferred lifetime 0, one short-lived radvd per RA (SIGKILLed: no
|
||||
# shutdown RA with router lifetime 0), stopping as soon as the prefix is
|
||||
# back on the interface -- a plain flap re-delegates the same /64 within
|
||||
# seconds and a deprecating RA sent after networkd re-announced it would
|
||||
# leave clients deprecated until the next periodic RA (08:19 today).
|
||||
systemd.services.router-radv-deprecate = {
|
||||
description = "Deprecate withdrawn DHCPv6-PD prefixes on the VLANs";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "systemd-networkd.service" ];
|
||||
path = [
|
||||
pkgs.iproute2
|
||||
pkgs.ipcalc
|
||||
pkgs.radvd
|
||||
];
|
||||
serviceConfig = {
|
||||
Restart = "always";
|
||||
RestartSec = 2;
|
||||
RuntimeDirectory = "router-radv-deprecate";
|
||||
};
|
||||
script = ''
|
||||
conf=$RUNTIME_DIRECTORY/radvd.conf
|
||||
pid=$RUNTIME_DIRECTORY/radvd.pid
|
||||
|
||||
# /64s of the global addresses currently on an interface.
|
||||
prefixes_on() {
|
||||
ip -o -6 addr show dev "$1" scope global | while read -r _ _ _ a _; do
|
||||
echo "$(ipcalc --no-decorate -n "$a")/''${a##*/}"
|
||||
done
|
||||
}
|
||||
|
||||
# "Deleted 4: vlan-lan inet6 2001:db8::1/64 scope global dynamic mngtmpaddr \ valid_lft ..."
|
||||
ip -o -6 monitor address | while read -r event _ dev _ addr _ scope rest; do
|
||||
[[ $event == Deleted && $dev == vlan-* && $scope == global && $rest == *dynamic* ]] || continue
|
||||
prefix="$(ipcalc --no-decorate -n "$addr")/''${addr##*/}"
|
||||
cat > "$conf" <<EOF
|
||||
interface $dev {
|
||||
AdvSendAdvert on;
|
||||
MinRtrAdvInterval 3;
|
||||
MaxRtrAdvInterval 4;
|
||||
AdvDefaultLifetime 1800;
|
||||
AdvCurHopLimit 0;
|
||||
prefix $prefix {
|
||||
AdvOnLink on;
|
||||
AdvAutonomous on;
|
||||
AdvPreferredLifetime 0;
|
||||
AdvValidLifetime 7200;
|
||||
};
|
||||
};
|
||||
EOF
|
||||
for _ in 1 2 3; do
|
||||
if prefixes_on "$dev" | grep -qxF "$prefix"; then
|
||||
echo "$dev: $prefix is back, leaving it announced"
|
||||
break
|
||||
fi
|
||||
echo "$dev: deprecating withdrawn prefix $prefix"
|
||||
rm -f "$pid"
|
||||
# radvd sends its first RA on start; the next would follow 3-4 s later.
|
||||
radvd -C "$conf" -p "$pid" -n -m stderr &
|
||||
sleep 1
|
||||
kill -KILL $! 2>/dev/null || true
|
||||
wait $! || true
|
||||
sleep 2
|
||||
done
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.services.heartbeat-push = {
|
||||
description = "Heartbeat push to uptime monitor";
|
||||
serviceConfig = {
|
||||
|
||||
Reference in new issue
Block a user