routeros: client VLANs resolve via the c1 recursor (gated, lock deferred) #163
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac!163
Loading…
Reference in a new issue
No description provided.
Delete branch "dns-client-recursor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Client VLANs get the c1 recursor (10.30.100.53) over DHCP, gated on the recursor answering from each router. Step 1 of the client cutover in lab/clusters#1673. Do not merge unattended: client DNS fails closed.
Router changes per network
10.30.100.5310.30.100.53udp/tcp 5310.30.100.538.8.8.8, 1.1.1.1The routers' own resolver (
routeros_ip_dns: NTP, the hairpinpublic_names) stays public.The legacy LAN stays public on purpose. mini runs the tofu-controller that applies router changes, so with mini on the recursor a recursor failure could block the apply that fixes it (lab/iac#50).
Resolver gate and rollback probe
modules/router/dns.tf: a netwatch dns proberesolver-gateon each router asks10.30.100.53forresolver.caosh.int.animeteamspeak.moe.terraform_data.resolver_gaterunsscripts/resolver-gate.sh, which polls/rest/tool/netwatchuntil the probe reportsup(120 s timeout). The provider fork hides netwatchstatus(MetaSkipFields), so a precondition can't read it. The script uses the same REST and netrc pattern asrollback/arm.sh, and the password comes fromROUTEROS_PASSWORDin the runner environment.rb5009-*/rollback.tfgets arecursorprobe. If the recursor dies inside the rollback window after an apply, the judge restores the backup. The probe only counts when it was up at arm time, so a recursor that is already down does not block a router fix.Not in this PR: the DNS lock
The lock (drop 53/853 udp+tcp to the WAN from the switched CIDRs) is in the code behind
client_dns_lock = falseinmodules/site. Shipping it with the switch would cut DNS for every client still on an old lease: lease time is 1d, so they renew at about 12 h and keep8.8.8.8until then. Flip it in a one-line follow-up PR at least a day after this one applied on both routers.The lock matches source CIDRs, not
ZONE-TRUSTED, because the legacy LAN shares that zone. DoH stays possible.IPv6
No change. There is no WAN v6 (ipv6.tf), so there is no public v6 DNS path to lock. The RAs carry no RDNSS: the routers have no v6 resolvers to advertise, and arch-ws on VLAN 30 shows no
IP6.DNStoday.Sim results, 2026-11-19
routeros/simon the containerlab pair r1/r2 with the harness OpenBao.Fixtures beyond the committed sim root:
10.30.20.53runs dnsmasq on10.30.100.53in place of the recursor.routeros/simroutes10.30.100.0/24to it in place of c1's BGP route.100.64.0.1and plays the public resolver on the WAN. The lab has no internet, so8.8.8.8itself can't be tested. The lock rules match the port and the WAN interface list and ignore the destination address, so the isp listener exercises them the same way.8.8.8.8 1.1.1.1downfor 120 s, exit 1. 0 changes on the routers besides the probe; all DHCP networks still public; gate tainted, next plan replaces itupafter 5 s, apply complete. Leases: VLAN 40 and 3010.30.100.53, VLAN 18.8.8.8 1.1.1.1. iot -> recursor udp+tcp answers; WAN DNS still answers everywhere (no lock)-var client_dns_lock=true)fw-dnat, beforefw-trusted. iot and trusted -> WAN DNS udp+tcp: no answer; ICMP to the WAN still passes; legacy LAN -> WAN DNS answers; recursor answers everywhere. Second plan emptyresolver-gateprobe goesdown; the next plan is empty (no gate re-run, applies not blocked)sim/rollback/run.sh g, new)[anchor peer peer-web recursor]; dnsmasq stopped inside the 180 s window; the judge loaded the backup 6 s after the fire time; the change's route is gone and therolled-back-marker is written: PASSThe new lock rules took effect about 2-3 s after the apply returned. In a timestamped loop, one query in that window got an answer and every later one was dropped. A gap in that direction only lets DNS through.
Two first-run misses in the sim log came from the fixture, not the change: dnsmasq didn't restart (log file permissions), so the gate correctly refused a second time; and one UDP query timed out right after a client's lease renewal.
task routeros:validate(all three device roots),routeros:guard,tofu fmt -check, and shellcheck on both scripts all pass.Not proven
Rollout (human awake)
routeros-rb5009-a, then-bon mini (approvePlan auto; never both at once). Each runner log should showresolver-gate[...] probe resolver-gate: up.10.30.100.53, thendig resolver.caosh.int.animeteamspeak.moe.client_dns_lock = true, then check thatdig @8.8.8.8 example.comtimes out from VLAN 30.Docs: ADR-0008 rule amended (dated),
docs/routeros/README.md"Client DNS",docs/routeros/rollback.mdscenario G.