users_to_router allows tcp/53 only — UDP DNS from captive clients fails, breaking hostname resolution

Chiusa
#749 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Amperstrand ci sta già lavorando.

Dal 8/10/2026.

  • #769 di @Amperstrand — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
go
Ambito
networking

Direzione di ricerca

Find the packaged NDS config in 99-tollgate-setup or the config defaults, and read how users_to_router is set. Reproduce the DNS timeout with nslookup example.com from a captive client, then verify the change allows UDP DNS; done means hostname resolution works for the client. A linked open pull request (#769) is already addressing this issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Migrated from Amperstrand/tollgate-module-basic-go#89 as part of the fork retirement — OpenTollGate/tollgate-module-basic-go is the single source of truth; the fork issue carries the original discussion and any lab evidence. Retirement plan: see the tracking issue linked in the migration comment there.]

Found during the 2026-09-05/06 local-lab campaign (physical-router-test-automation PR #101).

Symptom

A captive-portal client cannot resolve hostnames: curl http://example.com fails with "Could not resolve host" while the router's dnsmasq is healthy and answering on 10.99.99.1:53. IP-literal requests work.

Root cause

The NDS config shipped by the package sets:

users_to_router='allow tcp port 22' 'allow tcp port 53' 'allow tcp port 2121' ...

Only tcp/53 is allowed. Resolvers (glibc/musl, Android, browsers) query UDP first; the UDP query is dropped by NDS's ndsRTR chain, and the typical 5s-per-attempt timeout exceeds captive-portal min-browser and test budgets before any TCP fallback can happen. Empirically the client's resolution is dead in practice.

Suggested fix

Add 'allow udp port 53' to users_to_router in the packaged NDS config (99-tollgate-setup / config defaults). DNS for the portal flow is required pre-auth by design (the portal itself is often reached by name); there is no security gain from blocking UDP while allowing TCP to the same resolver.

Repro

  1. Lab VM with TollGate + NDS, client attached.
  2. nslookup example.com / any hostname from the client (pre- or post-auth) → timeout.
  3. Router-side nslookup example.com 127.0.0.1 → instant.
  4. IP-literal curl from the client → works (proves forwarding, not DNS).
Lingua principale
Go
Stelle
12
Fork
14
Merge medio
3g 20h
PR unite (30g)
261

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenTollGate/tollgate-module-basic-go

Tutte le issue di OpenTollGate/tollgate-module-basic-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.