Explorar el Código

fix: AdGuard port persistence and client IP ARP fallback (#420, #421)

Closes #420\nCloses #421
Nacho hace 3 meses
padre
commit
d6ae3ca8cb
Se han modificado 44 ficheros con 2034 adiciones y 553 borrados
  1. 1 0
      .gitignore
  2. 15 1
      CHANGELOG.md
  3. 48 1
      agent/executor/executor.go
  4. 23 0
      agent/executor/executor_test.go
  5. 136 0
      agent/probe/local.go
  6. 36 1
      agent/probe/payload.go
  7. 29 0
      agent/probe/probe.go
  8. 130 0
      agent/probe/probe_test.go
  9. 2 2
      app/package-lock.json
  10. 1 1
      app/package.json
  11. 23 18
      app/public/locales/en/translation.json
  12. 30 25
      app/public/locales/es/translation.json
  13. 5 5
      app/src/components/Layout.tsx
  14. 20 20
      app/src/components/topology/UsteerPanel.tsx
  15. 4 4
      app/src/data/DataProvider.tsx
  16. 2 2
      app/src/data/types.ts
  17. 66 67
      app/src/pages/Orchestration.tsx
  18. 88 36
      app/src/pages/Roaming.tsx
  19. 5 1
      server-go/.env.example
  20. 3 3
      server-go/internal/adapters/adapters_test.go
  21. 3 0
      server-go/internal/adapters/agent.go
  22. 2 1
      server-go/internal/adapters/agent_observe_dedup_test.go
  23. 44 0
      server-go/internal/adapters/arp_test.go
  24. 0 154
      server-go/internal/adapters/dawn_test.go
  25. 5 1
      server-go/internal/adapters/demo.go
  26. 208 120
      server-go/internal/adapters/live.go
  27. 117 0
      server-go/internal/adapters/live_kick_test.go
  28. 10 0
      server-go/internal/adapters/openwrt.go
  29. 11 6
      server-go/internal/adapters/portmonitor.go
  30. 35 20
      server-go/internal/adapters/portmonitor_test.go
  31. 42 42
      server-go/internal/adapters/types.go
  32. 99 0
      server-go/internal/adapters/usteer_test.go
  33. 16 0
      server-go/internal/config/config.go
  34. 12 1
      server-go/internal/httpapi/config.go
  35. 47 0
      server-go/internal/httpapi/config_test.go
  36. 28 5
      server-go/internal/httpapi/data.go
  37. 1 1
      server-go/internal/httpapi/httpapi_test.go
  38. 9 9
      server-go/internal/httpapi/orchestr.go
  39. 3 2
      server-go/internal/httpapi/server.go
  40. 2 1
      server-go/internal/orchestr/modules.go
  41. 367 0
      server-go/internal/orchestr/usteer.go
  42. 242 0
      server-go/internal/orchestr/usteer_test.go
  43. 28 3
      server-go/internal/roamevents/collector.go
  44. 36 0
      server-go/internal/roamevents/collector_test.go

+ 1 - 0
.gitignore

@@ -26,3 +26,4 @@ bin/
 
 # Binarios de agente embebidos (construidos por CI)
 server-go/internal/agentbin/agents/netpulse-agent-*
+.worktrees/

+ 15 - 1
CHANGELOG.md

@@ -5,7 +5,21 @@ Todos los cambios notables de NetPulse se documentan en este fichero.
 El formato se basa en [Keep a Changelog](https://keepachangelog.com/es/1.1.0/),
 y este proyecto se adhiere a [Versionado Semántico](https://semver.org/lang/es/).
 
-## [Unreleased]
+## [2.23.0] - 2026-08-31
+
+### Changed
+
+- **Migracion del daemon de roaming de DAWN a usteer (#410)**: el backend, agente y frontend ahora usan usteer, el daemon oficial de OpenWrt para client steering. Reemplaza las sondas DAWN por `local_info`, `remote_info` y `connected_clients` de usteer; actualiza las vistas `/roaming` y `/orchestration` y los textos i18n ES/EN; renombra `DawnPanel` a `UsteerPanel` y elimina helpers y tests de DAWN obsoletos.
+
+### Fixed
+
+- **Puerto de AdGuard Home remoto vuelve a 3000 tras guardar (#420)**: `PUT /api/config/adguard` ignoraba el campo `port` del JSON y solo extraía puerto de la cadena `host`. Como el modo standard envía host y puerto por separado, cualquier guardado terminaba usando 3000. Ahora el puerto explícito tiene prioridad y se persiste correctamente.
+- **Clientes sin dirección IP en el panel (#421)**: cuando un dispositivo no aparecía en las leases DHCP del router sondeado (porque el dnsmasq vive en otro equipo), la IP quedaba vacía. El agente ahora incluye la tabla ARP (`/proc/net/arp`) y `buildDevices` la usa como último fallback tras leases y `gl-clients`.
+- **Mensajes confusos al expulsar cliente en roaming (#411)**: `KickUsteerClient` ahora recorre todos los routers y continua si un `del_client` falla, en lugar de devolver el error crudo de SSH en el primer intento. Tambien corrige la comparacion de MAC, ya que usteer devuelve las MAC en minusculas en `connected_clients`. El mensaje de error ahora es `could not disconnect from <router>` en vez de `Process exited with status 4`.
+
+### Added
+
+- **Interruptor para desactivar alertas de ghost port (#419)**: nueva variable de entorno `GHOST_PORT_ENABLED` (default `0`). Cuando esta desactivada, el `PortMonitor` no genera alertas de puerto fantasma ni de recuperacion, eliminando los falsos positivos actuales mientras se afinan los agentes.
 
 ## [2.22.2] - 2026-08-31
 

+ 48 - 1
agent/executor/executor.go

@@ -191,6 +191,22 @@ var allowlist = map[string]opSpec{
 		},
 		configs: func(a map[string]string) []string { return nil },
 	},
+	// apk_remove: desinstala un paquete con apk (OpenWrt 24+).
+	"apk_remove": {
+		required: map[string]*regexp.Regexp{"package": rePackage},
+		build: func(a map[string]string) (string, []string) {
+			return "apk", []string{"del", a["package"]}
+		},
+		configs: func(a map[string]string) []string { return nil },
+	},
+	// opkg_remove: desinstala un paquete con opkg (OpenWrt clásico).
+	"opkg_remove": {
+		required: map[string]*regexp.Regexp{"package": rePackage},
+		build: func(a map[string]string) (string, []string) {
+			return "opkg", []string{"remove", a["package"]}
+		},
+		configs: func(a map[string]string) []string { return nil },
+	},
 	// download: uclient-fetch (presente en OpenWrt por defecto) con allowlist
 	// estricta de URL (solo releases oficiales de AdGuard).  El dest se valida
 	// con reFilePath. No shell libre: la URL va como arg, no interpolada.
@@ -322,6 +338,30 @@ var allowlist = map[string]opSpec{
 		},
 		configs: func(a map[string]string) []string { return nil },
 	},
+	// usteer_check: healthcheck del módulo usteer. Ejecuta
+	// `ubus call usteer remote_hosts` y verifica que devuelva JSON no vacío.
+	// Si falla, el executor revierte los snapshots UCI.
+	"usteer_check": {
+		exec: func(run Runner, a map[string]string) int {
+			out, code := run.Run("ubus", "call", "usteer", "remote_hosts")
+			if code != 0 {
+				return code
+			}
+			out = strings.TrimSpace(out)
+			if out == "" || out == "{}" {
+				return 1
+			}
+			var v map[string]any
+			if err := json.Unmarshal([]byte(out), &v); err != nil {
+				return 1
+			}
+			if len(v) == 0 {
+				return 1
+			}
+			return 0
+		},
+		configs: func(a map[string]string) []string { return nil },
+	},
 	// wifi_reload: aplica cambios en /etc/config/wireless sin reboot.
 	"wifi_reload": {
 		build: func(a map[string]string) (string, []string) {
@@ -418,7 +458,7 @@ func (e *Executor) Apply(ops []Op) ApplyResult {
 			_, code = e.run.Run(cmd, cmdArgs...)
 		}
 		if code != 0 {
-			if op.Kind == "wg_check" || op.Kind == "dawn_check" {
+			if op.Kind == "wg_check" || op.Kind == "dawn_check" || op.Kind == "usteer_check" {
 				// Healthcheck del módulo: rollback real restaurando snapshots UCI
 				// y relanzando los servicios afectados.
 				for cfg, snap := range snapshots {
@@ -432,10 +472,17 @@ func (e *Executor) Apply(ops []Op) ApplyResult {
 					e.run.Run("/etc/init.d/dawn", "restart")
 					e.run.Run("/sbin/wifi", "reload")
 				}
+				if op.Kind == "usteer_check" {
+					e.run.Run("/etc/init.d/usteer", "restart")
+					e.run.Run("/sbin/wifi", "reload")
+				}
 				errKey := "wg_check_failed"
 				if op.Kind == "dawn_check" {
 					errKey = "dawn_check_failed"
 				}
+				if op.Kind == "usteer_check" {
+					errKey = "usteer_check_failed"
+				}
 				return ApplyResult{Status: "rolled_back", Op: op.Desc, Error: errKey, Snapshot: strings.Join(affected, ","), DurationMs: ms(e.now(), start)}
 			}
 			// Revert staged changes y salir.

+ 23 - 0
agent/executor/executor_test.go

@@ -193,6 +193,29 @@ func TestValidateDawnCheck(t *testing.T) {
 	}
 }
 
+func TestValidateUsteerCheck(t *testing.T) {
+	if err := Validate(Op{Kind: "usteer_check", Args: map[string]string{}}); err != nil {
+		t.Fatalf("usteer_check debería validar: %v", err)
+	}
+}
+
+func TestValidateRemoveKinds(t *testing.T) {
+	for _, k := range []string{"apk_remove", "opkg_remove"} {
+		if err := Validate(Op{Kind: k, Args: map[string]string{"package": "luci-app-usteer"}}); err != nil {
+			t.Errorf("%s con package con guion debería validar: %v", k, err)
+		}
+		if err := Validate(Op{Kind: k, Args: map[string]string{"package": "dawn"}}); err != nil {
+			t.Errorf("%s debería validar: %v", k, err)
+		}
+		if err := Validate(Op{Kind: k, Args: map[string]string{}}); err == nil {
+			t.Errorf("%s sin package debería fallar", k)
+		}
+		if err := Validate(Op{Kind: k, Args: map[string]string{"package": "bad;rm -rf /"}}); err == nil {
+			t.Errorf("%s con package inválido debería fallar", k)
+		}
+	}
+}
+
 func TestValidateWifiReload(t *testing.T) {
 	if err := Validate(Op{Kind: "wifi_reload", Args: map[string]string{}}); err != nil {
 		t.Fatalf("wifi_reload debería validar: %v", err)

+ 136 - 0
agent/probe/local.go

@@ -109,7 +109,9 @@ func (p *Prober) Build(ctx context.Context, router, version string) *Payload {
 	pl.Data.Wireless = p.probeWireless(ctx, true)
 	pl.Data.DHCP = p.probeDHCP(ctx)
 	pl.Data.FDB = p.probeFDB(ctx)
+	pl.Data.Arp = p.probeArp(ctx)
 	pl.Data.Dawn = p.probeDawn(ctx)
+	pl.Data.Usteer = p.probeUsteer(ctx)
 	pl.Data.LuCI = p.probeLuCI(ctx)
 	// Discovery (#338): mDNS services + randomized MAC detection.
 	pl.Data.Discovery = p.probeDiscovery(ctx, pl.Data.Wireless)
@@ -135,6 +137,7 @@ func (p *Prober) BuildWireless(ctx context.Context, router, version string) *Pay
 	}
 	pl.Data.Wireless = p.probeWireless(ctx, false)
 	pl.Data.DHCP = p.probeDHCP(ctx)
+	pl.Data.Arp = p.probeArp(ctx)
 	return pl
 }
 
@@ -473,6 +476,125 @@ func (p *Prober) probeDawn(ctx context.Context) *DawnData {
 	return &DawnData{SSIDs: ssids}
 }
 
+// probeUsteer: lee el estado de usteer (roaming/steering) vía
+// `ubus call usteer local_info`, `remote_info` y `connected_clients`. Devuelve
+// nil si usteer no está instalado (fail-soft silencioso — la sección queda
+// ausente en el payload).
+func (p *Prober) probeUsteer(ctx context.Context) *UsteerData {
+	localOut := p.runBest(ctx, "ubus call usteer local_info", 5*time.Second)
+	remoteOut := p.runBest(ctx, "ubus call usteer remote_info", 5*time.Second)
+	if localOut == "" && remoteOut == "" {
+		return nil
+	}
+	clientsOut := p.runBest(ctx, "ubus call usteer connected_clients", 5*time.Second)
+	return ParseUsteer(localOut, remoteOut, clientsOut)
+}
+
+// usteerAPRaw es la forma cruda de una entrada de `ubus call usteer
+// local_info` / `remote_info` (por BSSID/iface).
+type usteerAPRaw struct {
+	BSSID  string `json:"bssid"`
+	SSID   string `json:"ssid"`
+	Freq   int    `json:"freq"`
+	NAssoc int    `json:"n_assoc"`
+	Load   int    `json:"load"`
+}
+
+// usteerClientRaw es la forma cruda de una entrada de `ubus call usteer
+// connected_clients` (por MAC).
+type usteerClientRaw struct {
+	Signal int `json:"signal"`
+}
+
+// ParseUsteer parsea las salidas de `ubus call usteer local_info`,
+// `remote_info` y `connected_clients` a un UsteerData (SSID → APs + clientes).
+// Función pura para testear sin ejecutar ubus.
+//
+//   - local_info:  {"<iface>": {bssid, ssid, freq, n_assoc, load, ...}}  (este router)
+//   - remote_info: {"<ip>#<iface>": {...}}                                (otros routers)
+//   - connected_clients: {"<iface>": {"<mac>": {signal, ...}}}
+//
+// Nota: usteer usa el nombre ubus de hostapd (`hostapd.phy0-ap0`) en
+// local_info/remote_info y el ifname (`hostapd.wlan0`) en connected_clients;
+// cuando ambas convenciones no casan, el cliente se omite (no se le asigna un
+// SSID erróneo).
+func ParseUsteer(localOut, remoteOut, clientsOut string) *UsteerData {
+	ssids := make(map[string]UsteerSSID)
+	ifaceSSID := map[string]string{}
+
+	addAP := func(ssid string, ap UsteerAP) {
+		s := ssids[ssid]
+		s.APs = append(s.APs, ap)
+		if s.Clients == nil {
+			s.Clients = map[string]UsteerClient{}
+		}
+		ssids[ssid] = s
+	}
+
+	if localOut != "" {
+		var local map[string]usteerAPRaw
+		if json.Unmarshal([]byte(localOut), &local) == nil {
+			for iface, ap := range local {
+				if ap.SSID == "" || ap.BSSID == "" {
+					continue
+				}
+				ifaceSSID[iface] = ap.SSID
+				addAP(ap.SSID, UsteerAP{
+					BSSID: strings.ToUpper(ap.BSSID), Freq: ap.Freq,
+					Load: ap.Load, Clients: ap.NAssoc, Local: true,
+				})
+			}
+		}
+	}
+
+	if remoteOut != "" {
+		var remote map[string]usteerAPRaw
+		if json.Unmarshal([]byte(remoteOut), &remote) == nil {
+			for key, ap := range remote {
+				if ap.SSID == "" || ap.BSSID == "" {
+					continue
+				}
+				host := key
+				if i := strings.IndexByte(key, '#'); i >= 0 {
+					host = key[:i]
+				}
+				addAP(ap.SSID, UsteerAP{
+					BSSID: strings.ToUpper(ap.BSSID), Hostname: host, Freq: ap.Freq,
+					Load: ap.Load, Clients: ap.NAssoc, Local: false,
+				})
+			}
+		}
+	}
+
+	if clientsOut != "" {
+		var clients map[string]map[string]usteerClientRaw
+		if json.Unmarshal([]byte(clientsOut), &clients) == nil {
+			for iface, macs := range clients {
+				ssid := ifaceSSID[iface]
+				if ssid == "" {
+					continue
+				}
+				s := ssids[ssid]
+				if s.Clients == nil {
+					s.Clients = map[string]UsteerClient{}
+				}
+				for mac, c := range macs {
+					if c.Signal >= 0 {
+						continue // señal 0/positiva = sin datos
+					}
+					s.Clients[strings.ToUpper(mac)] = UsteerClient{Signal: c.Signal}
+				}
+				ssids[ssid] = s
+			}
+		}
+	}
+
+	if len(ssids) == 0 {
+		return nil
+	}
+	return &UsteerData{SSIDs: ssids}
+}
+
 // probeDiscovery (#338): mDNS service discovery + randomized MAC detection.
 // Runs umdns browse; enriches with randomized MACs from wireless clients.
 func (p *Prober) probeDiscovery(ctx context.Context, wireless *WirelessData) *DiscoveryData {
@@ -498,3 +620,17 @@ func (p *Prober) probeDiscovery(ctx context.Context, wireless *WirelessData) *Di
 	}
 	return dd
 }
+
+// probeArp: tabla ARP del kernel (#377). nil si no hay fichero (equipo sin
+// ARP, p. ej. contenedor); mapa vacío es resultado real.
+func (p *Prober) probeArp(ctx context.Context) map[string]string {
+	out := p.runBest(ctx, CmdProcArp, 3*time.Second)
+	if out == "" {
+		return nil
+	}
+	m := ParseArp(out)
+	if m == nil {
+		m = map[string]string{}
+	}
+	return m
+}

+ 36 - 1
agent/probe/payload.go

@@ -29,7 +29,13 @@ type PayloadData struct {
 	Wireless *WirelessData `json:"wireless,omitempty"`
 	DHCP     *DHCPData     `json:"dhcp,omitempty"`
 	FDB      *FDBData      `json:"fdb,omitempty"`
-	Dawn     *DawnData     `json:"dawn,omitempty"` // Fase 14: DAWN roaming (solo si instalado)
+	// Arp: MAC → IPv4 de la tabla ARP del equipo (/proc/net/arp, #377).
+	// Resuelve IPs donde el DHCP no está en el equipo sondeado (APs tontos
+	// con el dnsmasq en otro router): cualquier router de la flota que
+	// enrute la LAN conoce el mapa completo.
+	Arp  map[string]string `json:"arp,omitempty"`
+	Dawn *DawnData         `json:"dawn,omitempty"` // Fase 14: DAWN roaming (solo si instalado)
+	Usteer *UsteerData     `json:"usteer,omitempty"` // usteer roaming (solo si instalado)
 	// LuCI: etiquetas de puertos/VLANs del router (issue #258), si están
 	// definidas en /etc/config/luci.
 	LuCI *LuCILabels `json:"luci,omitempty"`
@@ -113,6 +119,35 @@ type DawnClient struct {
 	VHT    bool   `json:"vht"`
 }
 
+// UsteerData: estado de usteer (roaming/steering). Solo si usteer está
+// instalado en el router. Trimmed del output de `ubus call usteer local_info`,
+// `remote_info` y `connected_clients` — solo lo que la UI necesita (APs por
+// SSID + clientes con señal).
+type UsteerData struct {
+	SSIDs map[string]UsteerSSID `json:"ssids"`
+}
+
+// UsteerSSID: por red WiFi (p. ej. "temiscira").
+type UsteerSSID struct {
+	APs     []UsteerAP              `json:"aps"`
+	Clients map[string]UsteerClient `json:"clients"` // MAC upper → cliente
+}
+
+// UsteerAP: un punto de acceso (local o remoto) visto por usteer en este SSID.
+type UsteerAP struct {
+	BSSID    string `json:"bssid"`
+	Hostname string `json:"hostname,omitempty"` // IP del AP remoto; vacío si local
+	Freq     int    `json:"freq"`               // MHz (>= 5000 → 5 GHz)
+	Load     int    `json:"load"`               // utilización % reportada por usteer
+	Clients  int    `json:"clients"`            // n_assoc
+	Local    bool   `json:"local"`              // true si es este router
+}
+
+// UsteerClient: un cliente WiFi visto por usteer con señal al AP asociado.
+type UsteerClient struct {
+	Signal int `json:"signal"` // dBm (negativo)
+}
+
 // DiscoveryData: mDNS service discovery + randomized MAC detection (#338).
 // Source: umdns browse on OpenWrt; falls back to parsing /tmp/umdns/ if
 // available. Best-effort: nil section if umdns is not installed.

+ 29 - 0
agent/probe/probe.go

@@ -11,6 +11,7 @@ package probe
 import (
 	"encoding/json"
 	"fmt"
+	"net"
 	"regexp"
 	"sort"
 	"strconv"
@@ -75,6 +76,8 @@ const (
 	// CmdPortStates: "<name> <operstate> <speed>" por interfaz.
 	CmdPortStates = `for d in /sys/class/net/*; do i=$(basename "$d"); ` +
 		`echo "$i $(cat $d/operstate 2>/dev/null) $(cat $d/speed 2>/dev/null || echo -1)"; done`
+	// CmdProcArp (#377): tabla ARP del kernel, "IP dev mac ..." por línea.
+	CmdProcArp     = "cat /proc/net/arp 2>/dev/null"
 	CmdBoardJSON   = "cat /etc/board.json 2>/dev/null"
 	CmdBrifMembers = "BR=br-lan; [ -d /sys/class/net/$BR ] || BR=br0; ls /sys/class/net/$BR/brif/ 2>/dev/null"
 	// CmdBridgeFDB: "==PORTS==" (port_no ifname) + "==MACS==" (port mac).
@@ -1193,3 +1196,29 @@ func hexNibble(c byte) (byte, error) {
 		return 0, fmt.Errorf("invalid hex nibble: %c", c)
 	}
 }
+
+// ParseArp parsea /proc/net/arp (#377): cabecera + líneas
+// "IP net/arp HW flags MAC mask device". Devuelve MAC (upper) → IP,
+// ignorando entradas incompletas (flags 0x0) y MACs nulas.
+func ParseArp(out string) map[string]string {
+	m := map[string]string{}
+	for _, line := range strings.Split(out, "\n") {
+		f := strings.Fields(line)
+		if len(f) < 4 || f[0] == "IP" {
+			continue
+		}
+		mac := strings.ToUpper(f[3])
+		if mac == "" || mac == "00:00:00:00:00:00" {
+			continue
+		}
+		// flags 0x0 = incomplete: el kernel retiene la IP sin vecino válido.
+		if f[2] == "0x0" {
+			continue
+		}
+		if net.ParseIP(f[0]) == nil {
+			continue
+		}
+		m[mac] = f[0]
+	}
+	return m
+}

+ 130 - 0
agent/probe/probe_test.go

@@ -197,6 +197,27 @@ func TestParseGlClients(t *testing.T) {
 	}
 }
 
+func TestParseArp(t *testing.T) {
+	out := "IP address       HW type     Flags       HW address            Mask     Device\n" +
+		"192.168.1.10     0x1         0x2         aa:bb:cc:dd:ee:ff     *        br-lan\n" +
+		"192.168.1.11     0x1         0x0         11:22:33:44:55:66     *        br-lan\n" +
+		"192.168.1.12     0x1         0x2         00:00:00:00:00:00     *        br-lan\n" +
+		"invalid          0x1         0x2         22:33:44:55:66:77     *        br-lan\n"
+	m := ParseArp(out)
+	if len(m) != 1 || m["AA:BB:CC:DD:EE:FF"] != "192.168.1.10" {
+		t.Fatalf("arp: %+v", m)
+	}
+	if _, ok := m["11:22:33:44:55:66"]; ok {
+		t.Fatal("entrada incompleta (0x0) no debe aparecer")
+	}
+	if _, ok := m["00:00:00:00:00:00"]; ok {
+		t.Fatal("MAC nula no debe aparecer")
+	}
+	if _, ok := m["22:33:44:55:66:77"]; ok {
+		t.Fatal("IP inválida no debe aparecer")
+	}
+}
+
 func TestParseWireless(t *testing.T) {
 	out := "A4:83:E7:21:0B:3C -48 5\nEC:71:DB:44:12:8A -72 2.4\n"
 	m := ParseWirelessClients(out)
@@ -661,3 +682,112 @@ func TestParseMdnsBrowse(t *testing.T) {
 		t.Errorf("HostByIP[192.168.1.60] = %q", host)
 	}
 }
+
+func TestParseUsteer(t *testing.T) {
+	// Fixtures con los shapes reales verificados en rt3 (local_info) y
+	// Flint2 (remote_info / connected_clients).
+	localInfo := `{
+  "hostapd.phy0-ap0": {
+    "bssid": "9c:9d:7e:1b:ea:b3",
+    "ssid": "temiscira",
+    "freq": 5260,
+    "n_assoc": 0,
+    "noise": -108,
+    "load": 3,
+    "max_assoc": 0,
+    "roam_events": { "source": 0, "target": 0 },
+    "rrm_nr": ["9c:9d:7e:1b:ea:b3", "temiscira", "9c9d7e1beab3ff5900008034090603023a00"]
+  },
+  "hostapd.phy1-ap0": {
+    "bssid": "9c:9d:7e:1b:ea:b2",
+    "ssid": "temiscira",
+    "freq": 2442,
+    "n_assoc": 1,
+    "load": 20
+  }
+}`
+
+	remoteInfo := `{
+  "192.168.1.3#hostapd.phy0-ap0": {
+    "bssid": "9c:9d:7e:1b:ea:b3",
+    "ssid": "temiscira",
+    "freq": 5260,
+    "n_assoc": 0,
+    "load": 3
+  },
+  "192.168.1.4#hostapd.phy0-ap0": {
+    "bssid": "aa:bb:cc:dd:ee:01",
+    "ssid": "temiscira",
+    "freq": 5260,
+    "n_assoc": 2,
+    "load": 40
+  }
+}`
+
+	connectedClients := `{
+  "hostapd.wlan0": {
+    "aa:bb:cc:dd:ee:ff": { "signal": -39 }
+  }
+}`
+
+	// 1. Sin remote_info: los APs locales se agrupan por SSID.
+	d := ParseUsteer(localInfo, "", "")
+	if d == nil {
+		t.Fatal("ParseUsteer(local) devolvió nil")
+	}
+	s, ok := d.SSIDs["temiscira"]
+	if !ok {
+		t.Fatalf("falta SSID temiscira: %v", d.SSIDs)
+	}
+	if len(s.APs) != 2 {
+		t.Fatalf("esperaba 2 APs locales, obtuve %d", len(s.APs))
+	}
+	if !s.APs[0].Local {
+		t.Error("el AP local debería tener Local=true")
+	}
+	if s.APs[0].BSSID != "9C:9D:7E:1B:EA:B3" {
+		t.Errorf("BSSID local = %q (esperaba uppercased)", s.APs[0].BSSID)
+	}
+
+	// 2. APs remotos: hostname = IP de la clave, Local=false.
+	d = ParseUsteer("", remoteInfo, "")
+	if d == nil {
+		t.Fatal("ParseUsteer(remote) devolvió nil")
+	}
+	rs := d.SSIDs["temiscira"]
+	if len(rs.APs) != 2 {
+		t.Fatalf("esperaba 2 APs remotos, obtuve %d", len(rs.APs))
+	}
+	if rs.APs[0].Local {
+		t.Error("el AP remoto debería tener Local=false")
+	}
+	if rs.APs[0].Hostname != "192.168.1.3" && rs.APs[1].Hostname != "192.168.1.3" {
+		t.Errorf("falta hostname IP en remotos: %+v", rs.APs)
+	}
+
+	// 3. connected_clients: si el iface casa con local_info, el cliente se
+	// agrupa por SSID con su señal.
+	d = ParseUsteer(localInfo, "", `{ "hostapd.phy0-ap0": { "aa:bb:cc:dd:ee:ff": { "signal": -39 } } }`)
+	if d == nil {
+		t.Fatal("ParseUsteer con clientes devolvió nil")
+	}
+	cs := d.SSIDs["temiscira"]
+	if c, ok := cs.Clients["AA:BB:CC:DD:EE:FF"]; !ok || c.Signal != -39 {
+		t.Errorf("cliente no agrupado: %v", cs.Clients)
+	}
+
+	// 4. iface sin casar (wlan0 vs phy0-ap0): no se asigna SSID erróneo.
+	_ = connectedClients
+	d = ParseUsteer(localInfo, "", connectedClients)
+	if d != nil && len(d.SSIDs["temiscira"].Clients) != 0 {
+		t.Errorf("cliente con iface no resuelto debería omitirse: %v", d.SSIDs["temiscira"].Clients)
+	}
+
+	// 5. Sin datos: nil.
+	if ParseUsteer("", "", "") != nil {
+		t.Error("ParseUsteer vacío debería devolver nil")
+	}
+	if ParseUsteer("{", "", "") != nil {
+		t.Error("ParseUsteer con JSON inválido debería devolver nil")
+	}
+}

+ 2 - 2
app/package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "netpulse",
-  "version": "2.10.0",
+  "version": "2.23.0",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "netpulse",
-      "version": "2.10.0",
+      "version": "2.23.0",
       "dependencies": {
         "@hookform/resolvers": "^5.2.2",
         "@radix-ui/react-accordion": "^1.2.12",

+ 1 - 1
app/package.json

@@ -1,7 +1,7 @@
 {
   "name": "netpulse",
   "private": true,
-  "version": "2.22.2",
+  "version": "2.23.0",
   "type": "module",
   "scripts": {
     "dev": "vite",

+ 23 - 18
app/public/locales/en/translation.json

@@ -335,10 +335,10 @@
   },
   "roaming": {
     "subtitle": "Roaming and WiFi mesh status",
-    "loading": "Loading DAWN data…",
-    "error": "Could not load DAWN status. Check that the service runs on your routers.",
+    "loading": "Loading usteer data…",
+    "error": "Could not load usteer status. Check that the service runs on your routers.",
     "noApi": "Available only with a live backend.",
-    "empty": "No router has DAWN enabled. Install it on OpenWrt to see the roaming mesh.",
+    "empty": "No router has usteer enabled. Install it on OpenWrt to see the roaming mesh.",
     "tabMatrix": "Matrix",
     "tab11r": "802.11r",
     "tabSurvey": "Survey",
@@ -346,7 +346,7 @@
     "comingSoon": "Coming soon",
     "matrix": {
       "title": "Signal matrix",
-      "description": "Signal of each client as seen by each AP (DAWN hearing map). Clients in the marginal zone are roaming candidates.",
+      "description": "Signal of each client as seen by each AP (usteer hearing map). Clients in the marginal zone are roaming candidates.",
       "colClient": "Client",
       "colAp": "Access point",
       "filterBand": "Band",
@@ -359,6 +359,11 @@
       "legendFair": "-70 to -80 dBm (fair)",
       "legendWeak": "≥ -85 dBm (marginal)"
     },
+    "kick": {
+      "title": "Kick from AP to force reconnection",
+      "label": "Kick {{name}}",
+      "error": "Could not kick the client"
+    },
     "dot11r": {
       "title": "802.11r status",
       "description": "Fast BSS Transition (fast roaming) read from `uci show wireless`. Without it the client fully re-authenticates when jumping APs (1-2 s hiccup).",
@@ -409,7 +414,7 @@
     },
     "events": {
       "title": "Roaming events",
-      "description": "Client connections, disconnections and DAWN decisions. 30-day history, ingested every 60 s.",
+      "description": "Client connections, disconnections and roaming decisions. 30-day history, ingested every 60 s.",
       "empty": "No events yet. Routers start reporting as soon as the poller reaches them.",
       "filterType": "Filter by type",
       "type_all": "All",
@@ -778,8 +783,8 @@
     "tagDevices": "Tag devices",
     "zoomIn": "Zoom in",
     "zoomOut": "Zoom out",
-    "dawn": {
-      "title": "WiFi roaming (DAWN)",
+    "usteer": {
+      "title": "WiFi roaming (usteer)",
       "caption": "Band-steering mesh between APs",
       "clients": "{{count}} clients",
       "util": "{{pct}}% util."
@@ -1291,7 +1296,7 @@
       "ddns": "DDNS",
       "sqm": "QoS (SQM)",
       "wireguard": "WireGuard",
-      "dawn": "DAWN"
+      "usteer": "usteer"
     },
     "warn": {
       "managed_by_firmware": "This router ships a vendor AdGuard Home (GL.iNet). NetPulse won't manage it to avoid breaking its UI: configure it from the router's own interface.",
@@ -1377,16 +1382,16 @@
         "inactive": "Tunnel inactive"
       }
     },
-    "dawn": {
-      "enable": "Enable DAWN (WiFi roaming)",
-      "allowNonGateway": "Allow DAWN on non-gateway routers",
-      "nonGatewayWarning": "DAWN can run on any WiFi AP; it only needs the package, full wpad and aligned roaming parameters.",
+    "usteer": {
+      "enable": "Enable usteer (WiFi roaming)",
+      "allowNonGateway": "Allow usteer on non-gateway routers",
+      "nonGatewayWarning": "usteer can run on any WiFi AP; it only needs the package, full wpad and aligned roaming parameters.",
       "ssid": "SSID (empty = all)",
       "mobilityDomain": "Mobility domain",
-      "broadcastIp": "Broadcast IP",
-      "tcpPort": "TCP port",
-      "sharedKey": "Shared key",
-      "iv": "IV",
+      "aggressiveness": "Aggressiveness",
+      "bandSteeringThreshold": "Band-steering threshold",
+      "loadBalancingThreshold": "Load-balancing threshold",
+      "debugLevel": "Debug level",
       "roaming": "Roaming",
       "ieee80211k": "802.11k",
       "ieee80211r": "802.11r",
@@ -1395,8 +1400,8 @@
       "ftOverDs": "FT over DS",
       "ftPskGenerateLocal": "Generate local FT-PSK",
       "method": {
-        "active": "DAWN active",
-        "inactive": "DAWN inactive"
+        "active": "usteer active",
+        "inactive": "usteer inactive"
       }
     }
   },

+ 30 - 25
app/public/locales/es/translation.json

@@ -321,7 +321,7 @@
     "moreOptions": "Más opciones",
     "overview": "Resumen",
     "reports": "Informes",
-    "roaming": "Roaming WiFi",
+    "roaming": "Itinerancia WiFi",
     "routerDetail": "Detalle del dispositivo",
     "routers": "Dispositivos",
     "settings": "Ajustes",
@@ -334,11 +334,11 @@
     "orchestration": "Orquestación"
   },
   "roaming": {
-    "subtitle": "Estado del roaming y la malla WiFi",
-    "loading": "Cargando datos de DAWN…",
-    "error": "No se pudo cargar el estado de DAWN. Comprueba que el servicio corre en tus routers.",
+    "subtitle": "Estado de la itinerancia WiFi y la malla WiFi",
+    "loading": "Cargando datos de usteer…",
+    "error": "No se pudo cargar el estado de usteer. Comprueba que el servicio corre en tus routers.",
     "noApi": "Disponible solo con backend en vivo.",
-    "empty": "Ningún router tiene DAWN activo. Instálalo en OpenWrt para ver la malla de roaming.",
+    "empty": "Ningún router tiene usteer activo. Instálalo en OpenWrt para ver la malla de itinerancia.",
     "tabMatrix": "Matriz",
     "tab11r": "802.11r",
     "tabSurvey": "Survey",
@@ -346,7 +346,7 @@
     "comingSoon": "Próximamente",
     "matrix": {
       "title": "Matriz de señal",
-      "description": "Señal de cada cliente vista por cada AP (hearing map de DAWN). Los clientes en zona límite son candidatos a roaming.",
+      "description": "Señal de cada cliente vista por cada AP (hearing map de usteer). Los clientes en zona límite son candidatos a itinerancia.",
       "colClient": "Cliente",
       "colAp": "Punto de acceso",
       "filterBand": "Banda",
@@ -359,9 +359,14 @@
       "legendFair": "-70 a -80 dBm (aceptable)",
       "legendWeak": "≥ -85 dBm (límite)"
     },
+    "kick": {
+      "title": "Expulsar del AP para forzar reconexión",
+      "label": "Expulsar a {{name}}",
+      "error": "No se pudo expulsar al cliente"
+    },
     "dot11r": {
       "title": "Estado 802.11r",
-      "description": "Fast BSS Transition (roaming rápido) leído de `uci show wireless`. Sin él, el cliente se re-autentica completo al saltar de AP (corte de 1-2 s).",
+      "description": "Fast BSS Transition (itinerancia rápida) leído de `uci show wireless`. Sin él, el cliente se re-autentica completo al saltar de AP (corte de 1-2 s).",
       "empty": "Ningún router tiene 802.11r habilitado en ningún SSID.",
       "allOn": "802.11r activo en los {{n}} SSIDs",
       "partial": "Parcial: activo en {{on}} de {{total}} SSIDs",
@@ -387,7 +392,7 @@
       "ftOverAir": "Over-the-air",
       "pskLocal": "PSK local",
       "radius": "RADIUS externo",
-      "coverageHint": "Cobertura = interfaces con 802.11r / total de interfaces en ese SSID. Para roaming fluido debe ser 100% en cada SSID.",
+      "coverageHint": "Cobertura = interfaces con 802.11r / total de interfaces en ese SSID. Para itinerancia fluida debe ser 100% en cada SSID.",
       "noIfaces": "Sin interfaces wifi.",
       "unreachable": "Router no accesible por SSH."
     },
@@ -408,8 +413,8 @@
       "legendCongested": "≥ 70% (congestionado)"
     },
     "events": {
-      "title": "Eventos de roaming",
-      "description": "Conexiones, desconexiones y decisiones de DAWN por cliente. Histórico de 30 días, ingesta cada 60 s.",
+      "title": "Eventos de itinerancia",
+      "description": "Conexiones, desconexiones y decisiones de itinerancia por cliente. Histórico de 30 días, ingesta cada 60 s.",
       "empty": "Sin eventos todavía. Los routers empiezan a reportar en cuanto el poller los alcanza.",
       "filterType": "Filtrar por tipo",
       "type_all": "Todos",
@@ -421,7 +426,7 @@
       "dawn": "DAWN",
       "other": "Otro"
     },
-    "tabsLabel": "Vistas de roaming"
+    "tabsLabel": "Vistas de itinerancia"
   },
   "notFound": {
     "construction": "Esta página está en construcción. El mockup la completará en la siguiente iteración."
@@ -778,8 +783,8 @@
     "tagDevices": "Etiquetar dispositivos",
     "zoomIn": "Acercar",
     "zoomOut": "Alejar",
-    "dawn": {
-      "title": "Roaming WiFi (DAWN)",
+    "usteer": {
+      "title": "Itinerancia WiFi (usteer)",
       "caption": "Malla de band-steering entre APs",
       "clients": "{{count}} clientes",
       "util": "{{pct}}% util."
@@ -1291,7 +1296,7 @@
       "ddns": "DDNS",
       "sqm": "QoS (SQM)",
       "wireguard": "WireGuard",
-      "dawn": "DAWN"
+      "usteer": "usteer"
     },
     "warn": {
       "managed_by_firmware": "Este router trae un AdGuard Home del fabricante (GL.iNet). NetPulse no lo gestiona para no romper su UI: configúralo desde la interfaz del router.",
@@ -1377,17 +1382,17 @@
         "inactive": "Túnel inactivo"
       }
     },
-    "dawn": {
-      "enable": "Activar DAWN (roaming WiFi)",
-      "allowNonGateway": "Permitir DAWN en routers no-gateway",
-      "nonGatewayWarning": "DAWN puede ejecutarse en cualquier AP con WiFi; solo necesita el paquete, wpad completo y los parámetros de roaming alineados.",
+    "usteer": {
+      "enable": "Activar usteer (itinerancia WiFi)",
+      "allowNonGateway": "Permitir usteer en routers no-gateway",
+      "nonGatewayWarning": "usteer puede ejecutarse en cualquier AP con WiFi; solo necesita el paquete, wpad completo y los parámetros de itinerancia alineados.",
       "ssid": "SSID (vacío = todas)",
       "mobilityDomain": "Dominio de movilidad",
-      "broadcastIp": "IP de broadcast",
-      "tcpPort": "Puerto TCP",
-      "sharedKey": "Clave compartida",
-      "iv": "IV",
-      "roaming": "Roaming",
+      "aggressiveness": "Agresividad",
+      "bandSteeringThreshold": "Umbral de band-steering",
+      "loadBalancingThreshold": "Umbral de balanceo de carga",
+      "debugLevel": "Nivel de debug",
+      "roaming": "Itinerancia",
       "ieee80211k": "802.11k",
       "ieee80211r": "802.11r",
       "ieee80211v": "802.11v",
@@ -1395,8 +1400,8 @@
       "ftOverDs": "FT over DS",
       "ftPskGenerateLocal": "Generar FT-PSK local",
       "method": {
-        "active": "DAWN activo",
-        "inactive": "DAWN inactivo"
+        "active": "usteer activo",
+        "inactive": "usteer inactivo"
       }
     }
   },

+ 5 - 5
app/src/components/Layout.tsx

@@ -201,19 +201,19 @@ function GatewayStatus() {
 // Sidebar desktop (≥1024px) — 232px
 // ---------------------------------------------------------------------------
 
-/** Items de nav visibles según el overview. /roaming solo si hay DAWN. */
+/** Items de nav visibles según el overview. /roaming solo si hay usteer. */
 function useVisibleNavItems(): NavItem[] {
-  const { dawn, orchestration } = useNetPulse()
-  const dawnAvailable = !!dawn?.available
+  const { usteer, orchestration } = useNetPulse()
+  const usteerAvailable = !!usteer?.available
   return useMemo(
     () =>
       NAV_ITEMS.filter(
         (it) =>
-          (it.to !== '/roaming' || dawnAvailable) &&
+          (it.to !== '/roaming' || usteerAvailable) &&
           // Orquestación: opt-in del admin (#121). Oculto por defecto.
           (it.to !== '/orchestration' || !!orchestration),
       ),
-    [dawnAvailable, orchestration],
+    [usteerAvailable, orchestration],
   )
 }
 

+ 20 - 20
app/src/components/topology/DawnPanel.tsx → app/src/components/topology/UsteerPanel.tsx

@@ -1,6 +1,6 @@
 /**
- * Panel DAWN (band-steering/roaming): APs de la malla con banda, canal,
- * utilización y clientes. Datos de /api/dawn (ubus dawn get_network).
+ * Panel usteer (band-steering/roaming): APs de la malla con banda, frecuencia,
+ * utilización y clientes. Datos de /api/usteer (ubus usteer local_info).
  */
 import { useEffect, useState } from 'react'
 import { useTranslation } from 'react-i18next'
@@ -9,43 +9,43 @@ import { SectionHeader } from '@/components/SectionHeader'
 import { redirectLogin } from '@/data/DataProvider'
 import { cn } from '@/lib/utils'
 
-interface DawnAp {
+interface UsteerAp {
   ssid: string
   bssid: string
   hostname: string
   band: string
-  channel: number
+  freq: number
   utilizationPct: number
-  clients: number
+  clientCount: number
   iface: string
 }
 
-interface DawnMesh {
+interface UsteerMesh {
   routerId: string
   name: string
-  dawn: boolean
+  usteer: boolean
   apsSeen: number
 }
 
-export function DawnPanel() {
+export function UsteerPanel() {
   const { t } = useTranslation()
-  const [aps, setAps] = useState<DawnAp[] | null>(null)
-  const [mesh, setMesh] = useState<DawnMesh[] | null>(null)
+  const [aps, setAps] = useState<UsteerAp[] | null>(null)
+  const [mesh, setMesh] = useState<UsteerMesh[] | null>(null)
 
   useEffect(() => {
     let disposed = false
     const load = async () => {
       try {
-        const res = await fetch('/api/dawn')
+        const res = await fetch('/api/usteer')
         if (res.status === 401) redirectLogin()
         if (!res.ok) return
-        const json = (await res.json()) as { aps: DawnAp[]; mesh?: DawnMesh[] }
+        const json = (await res.json()) as { aps: UsteerAp[]; mesh?: UsteerMesh[] }
         if (!disposed) {
           setAps(json.aps)
           setMesh(json.mesh ?? null)
         }
       } catch {
-        /* sin DAWN */
+        /* sin usteer */
       }
     }
     void load()
@@ -57,23 +57,23 @@ export function DawnPanel() {
   }, [])
 
   if (!aps || aps.length === 0) return null
-  const active = mesh?.filter((m) => m.dawn).length ?? 0
+  const active = mesh?.filter((m) => m.usteer).length ?? 0
   const total = mesh?.length ?? 0
 
   return (
     <section className="rounded-2xl border border-border bg-surface p-5 md:p-6">
-      <SectionHeader title={t('topology.dawn.title')} />
+      <SectionHeader title={t('topology.usteer.title')} />
       <div className="mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-caption text-text-muted">
-        <span>{t('topology.dawn.caption')}</span>
+        <span>{t('topology.usteer.caption')}</span>
         {mesh && (
           <span className="inline-flex items-center gap-1.5">
             <span className={cn('h-1.5 w-1.5 rounded-full', active === total ? 'bg-ok' : 'bg-warn')} />
-            DAWN {active}/{total}
+            usteer {active}/{total}
           </span>
         )}
         {mesh?.map((m) => (
           <span key={m.routerId} className="inline-flex items-center gap-1 rounded-full bg-elevated px-2 py-0.5 font-mono text-[10px]">
-            <span className={cn('h-1.5 w-1.5 rounded-full', m.dawn ? 'bg-ok' : 'bg-danger')} />
+            <span className={cn('h-1.5 w-1.5 rounded-full', m.usteer ? 'bg-ok' : 'bg-danger')} />
             {m.name} · {m.apsSeen} APs
           </span>
         ))}
@@ -93,11 +93,11 @@ export function DawnPanel() {
             <div className="min-w-0 flex-1">
               <div className="truncate text-sm font-medium text-text-primary">{ap.hostname}</div>
               <div className="font-mono text-caption text-text-muted">
-                {ap.band} · ch {ap.channel} · {t('topology.dawn.util', { pct: ap.utilizationPct })}
+                {ap.band} · {ap.freq} MHz · {t('topology.usteer.util', { pct: ap.utilizationPct })}
               </div>
             </div>
             <span className="shrink-0 font-mono text-caption text-text-secondary">
-              {t('topology.dawn.clients', { count: ap.clients })}
+              {t('topology.usteer.clients', { count: ap.clientCount })}
             </span>
           </div>
         ))}

+ 4 - 4
app/src/data/DataProvider.tsx

@@ -103,8 +103,8 @@ export interface NetPulseData {
    * Ausente en demo y con servidores viejos → model.ts usa su cálculo local.
    */
   topology?: TopoSemantics
-  /** Disponibilidad de DAWN (roaming); ausente = no mostrar /roaming. */
-  dawn?: { available: boolean }
+  /** Disponibilidad de usteer (roaming); ausente = no mostrar /roaming. */
+  usteer?: { available: boolean }
   /** Menú de orquestación activado por el admin (#121); ausente = oculto. */
   orchestration?: boolean
 }
@@ -322,7 +322,7 @@ export const EMPTY_EXTRAS: RouterExtras = {
 // ---------------------------------------------------------------------------
 
 /** Redirect compartido 401 → /login (evento para AuthGate + assign). Lo usan
- * el provider y las páginas que hacen fetch directo (Roaming, DawnPanel). */
+ * el provider y las páginas que hacen fetch directo (Roaming, UsteerPanel). */
 export function redirectLogin(): never {
   window.dispatchEvent(new Event('netpulse-unauthorized'))
   window.location.assign('/login')
@@ -469,7 +469,7 @@ export function DataProvider({ children }: { children: React.ReactNode }) {
       unreadAlerts: o.unreadAlerts,
       vm,
       topology: o.topology,
-      dawn: o.dawn,
+      usteer: o.usteer,
       orchestration: o.orchestration,
       ...(o.devices ? { devices: o.devices } : {}),
     }))

+ 2 - 2
app/src/data/types.ts

@@ -374,8 +374,8 @@ export interface OverviewBundle {
   vm?: number
   /** Semántica de topología precalculada (SPEC-65 D65-3); ausente = fallback local. */
   topology?: TopoSemantics
-  /** Disponibilidad de DAWN (roaming/band-steering); ausente = no mostrar /roaming. */
-  dawn?: { available: boolean }
+  /** Disponibilidad de usteer (roaming/band-steering); ausente = no mostrar /roaming. */
+  usteer?: { available: boolean }
   /** Menú de orquestación activado por el admin (#121); ausente = oculto. */
   orchestration?: boolean
   /** Devices from the same polled snapshot as topology.rings. When present,

+ 66 - 67
app/src/pages/Orchestration.tsx

@@ -6,7 +6,7 @@ import { ChevronRight, CheckCircle2, AlertCircle, Loader2, Wand2, ShieldAlert, P
 import { useNetPulse } from '@/data/DataProvider'
 import { useAuth } from '@/data/AuthContext'
 
-type Module = 'adguard' | 'guestwifi' | 'ddns' | 'sqm' | 'wireguard' | 'dawn'
+type Module = 'adguard' | 'guestwifi' | 'ddns' | 'sqm' | 'wireguard' | 'usteer'
 
 interface Op {
   kind: string
@@ -76,20 +76,20 @@ export default function Orchestration() {
   const [wgInterface, setWgInterface] = useState('wg0')
   const [wgPeers, setWgPeers] = useState([{ name: '', publicKey: '', allowedIps: '' }])
   const [wgAdminPeer, setWgAdminPeer] = useState('')
-  // DAWN (Fase 17.9).
-  const [dawnEnabled, setDawnEnabled] = useState(true)
-  const [dawnSsid, setDawnSsid] = useState('')
-  const [dawnMobilityDomain, setDawnMobilityDomain] = useState('2025')
-  const [dawnBroadcastIp, setDawnBroadcastIp] = useState('192.168.1.255')
-  const [dawnTcpPort, setDawnTcpPort] = useState('1026')
-  const [dawnSharedKey, setDawnSharedKey] = useState('')
-  const [dawnIv, setDawnIv] = useState('')
-  const [dawnK, setDawnK] = useState(true)
-  const [dawnR, setDawnR] = useState(true)
-  const [dawnV, setDawnV] = useState(true)
-  const [dawnBssTransition, setDawnBssTransition] = useState(true)
-  const [dawnFtOverDs, setDawnFtOverDs] = useState(false)
-  const [dawnFtPskGenerateLocal, setDawnFtPskGenerateLocal] = useState(true)
+  // usteer (Fase 17.10; sustituye a DAWN).
+  const [usteerEnabled, setUsteerEnabled] = useState(true)
+  const [usteerSsid, setUsteerSsid] = useState('')
+  const [usteerMobilityDomain, setUsteerMobilityDomain] = useState('2025')
+  const [usteerAggressiveness, setUsteerAggressiveness] = useState('3')
+  const [usteerBandSteeringThreshold, setUsteerBandSteeringThreshold] = useState('5')
+  const [usteerLoadBalancingThreshold, setUsteerLoadBalancingThreshold] = useState('0')
+  const [usteerDebugLevel, setUsteerDebugLevel] = useState('2')
+  const [usteerK, setUsteerK] = useState(true)
+  const [usteerR, setUsteerR] = useState(true)
+  const [usteerV, setUsteerV] = useState(true)
+  const [usteerBssTransition, setUsteerBssTransition] = useState(true)
+  const [usteerFtOverDs, setUsteerFtOverDs] = useState(false)
+  const [usteerFtPskGenerateLocal, setUsteerFtPskGenerateLocal] = useState(true)
 
   // issue #120: todos los módulos son gateway-only por defecto. El toggle
   // "advanced" permite un router no-gateway (con warning + checks).
@@ -154,22 +154,21 @@ export default function Orchestration() {
             .map((p) => ({ name: p.name, publicKey: p.publicKey.trim(), allowedIps: p.allowedIps.trim() })),
           adminPeerPubkey: wgAdminPeer.trim(),
         }
-      case 'dawn':
+      case 'usteer':
         return {
-          enabled: dawnEnabled,
-          ssid: dawnSsid,
-          mobilityDomain: dawnMobilityDomain,
-          broadcastIp: dawnBroadcastIp,
-          tcpPort: dawnTcpPort,
-          sharedKey: dawnSharedKey,
-          iv: dawnIv,
-          ieee80211k: dawnK,
-          ieee80211r: dawnR,
-          ieee80211v: dawnV,
-          bssTransition: dawnBssTransition,
-          ftOverDs: dawnFtOverDs,
-          ftPskGenerateLocal: dawnFtPskGenerateLocal,
-          allowNonGateway,
+          enabled: usteerEnabled,
+          ssid: usteerSsid,
+          mobilityDomain: usteerMobilityDomain,
+          aggressiveness: usteerAggressiveness,
+          bandSteeringThreshold: usteerBandSteeringThreshold,
+          loadBalancingThreshold: usteerLoadBalancingThreshold,
+          debugLevel: usteerDebugLevel,
+          ieee80211k: usteerK,
+          ieee80211r: usteerR,
+          ieee80211v: usteerV,
+          bssTransition: usteerBssTransition,
+          ftOverDs: usteerFtOverDs,
+          ftPskGenerateLocal: usteerFtPskGenerateLocal,
         }
       default:
         return { enabled: agEnabled, port: agPort, upstreamDns: agDns, allowNonGateway }
@@ -277,7 +276,7 @@ export default function Orchestration() {
 
       {/* Selector de módulo */}
       <div className="flex flex-wrap gap-2">
-        {(['adguard', 'guestwifi', 'ddns', 'sqm', 'wireguard', 'dawn'] as Module[]).map((m) => (
+        {(['adguard', 'guestwifi', 'ddns', 'sqm', 'wireguard', 'usteer'] as Module[]).map((m) => (
           <button
             key={m}
             type="button"
@@ -644,101 +643,101 @@ export default function Orchestration() {
             </>
           )}
 
-          {module === 'dawn' && (
+          {module === 'usteer' && (
             <>
               <label className="flex items-center gap-2 pt-6">
                 <input
                   type="checkbox"
-                  checked={dawnEnabled}
-                  onChange={(e) => setDawnEnabled(e.target.checked)}
+                  checked={usteerEnabled}
+                  onChange={(e) => setUsteerEnabled(e.target.checked)}
                   className="h-4 w-4 rounded border-border"
                 />
-                <span className="text-sm text-text-primary">{t('orchestration.dawn.enable')}</span>
+                <span className="text-sm text-text-primary">{t('orchestration.usteer.enable')}</span>
               </label>
 
-              {dawnEnabled && (
+              {usteerEnabled && (
                 <>
                   <label className="flex flex-col gap-1">
-                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.dawn.ssid')}</span>
+                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.usteer.ssid')}</span>
                     <input
                       type="text"
-                      value={dawnSsid}
-                      onChange={(e) => setDawnSsid(e.target.value)}
+                      value={usteerSsid}
+                      onChange={(e) => setUsteerSsid(e.target.value)}
                       className="rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary"
                     />
                   </label>
                   <label className="flex flex-col gap-1">
-                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.dawn.mobilityDomain')}</span>
+                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.usteer.mobilityDomain')}</span>
                     <input
                       type="text"
-                      value={dawnMobilityDomain}
-                      onChange={(e) => setDawnMobilityDomain(e.target.value)}
+                      value={usteerMobilityDomain}
+                      onChange={(e) => setUsteerMobilityDomain(e.target.value)}
                       className="rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary"
                     />
                   </label>
                   <label className="flex flex-col gap-1">
-                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.dawn.broadcastIp')}</span>
+                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.usteer.aggressiveness')}</span>
                     <input
                       type="text"
-                      value={dawnBroadcastIp}
-                      onChange={(e) => setDawnBroadcastIp(e.target.value)}
+                      value={usteerAggressiveness}
+                      onChange={(e) => setUsteerAggressiveness(e.target.value)}
                       className="rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary"
                     />
                   </label>
                   <label className="flex flex-col gap-1">
-                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.dawn.tcpPort')}</span>
+                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.usteer.bandSteeringThreshold')}</span>
                     <input
                       type="text"
-                      value={dawnTcpPort}
-                      onChange={(e) => setDawnTcpPort(e.target.value)}
+                      value={usteerBandSteeringThreshold}
+                      onChange={(e) => setUsteerBandSteeringThreshold(e.target.value)}
                       className="rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary"
                     />
                   </label>
                   <label className="flex flex-col gap-1">
-                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.dawn.sharedKey')}</span>
+                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.usteer.loadBalancingThreshold')}</span>
                     <input
                       type="text"
-                      value={dawnSharedKey}
-                      onChange={(e) => setDawnSharedKey(e.target.value)}
+                      value={usteerLoadBalancingThreshold}
+                      onChange={(e) => setUsteerLoadBalancingThreshold(e.target.value)}
                       className="rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary"
                     />
                   </label>
                   <label className="flex flex-col gap-1">
-                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.dawn.iv')}</span>
+                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.usteer.debugLevel')}</span>
                     <input
                       type="text"
-                      value={dawnIv}
-                      onChange={(e) => setDawnIv(e.target.value)}
+                      value={usteerDebugLevel}
+                      onChange={(e) => setUsteerDebugLevel(e.target.value)}
                       className="rounded-lg border border-border bg-canvas px-3 py-2 text-sm text-text-primary"
                     />
                   </label>
 
                   <div className="lg:col-span-2">
-                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.dawn.roaming')}</span>
+                    <span className="text-caption font-medium text-text-secondary">{t('orchestration.usteer.roaming')}</span>
                     <div className="mt-2 flex flex-wrap gap-4">
                       <label className="flex items-center gap-2">
-                        <input type="checkbox" checked={dawnK} onChange={(e) => setDawnK(e.target.checked)} className="h-4 w-4 rounded border-border" />
-                        <span className="text-sm text-text-primary">{t('orchestration.dawn.ieee80211k')}</span>
+                        <input type="checkbox" checked={usteerK} onChange={(e) => setUsteerK(e.target.checked)} className="h-4 w-4 rounded border-border" />
+                        <span className="text-sm text-text-primary">{t('orchestration.usteer.ieee80211k')}</span>
                       </label>
                       <label className="flex items-center gap-2">
-                        <input type="checkbox" checked={dawnR} onChange={(e) => setDawnR(e.target.checked)} className="h-4 w-4 rounded border-border" />
-                        <span className="text-sm text-text-primary">{t('orchestration.dawn.ieee80211r')}</span>
+                        <input type="checkbox" checked={usteerR} onChange={(e) => setUsteerR(e.target.checked)} className="h-4 w-4 rounded border-border" />
+                        <span className="text-sm text-text-primary">{t('orchestration.usteer.ieee80211r')}</span>
                       </label>
                       <label className="flex items-center gap-2">
-                        <input type="checkbox" checked={dawnV} onChange={(e) => setDawnV(e.target.checked)} className="h-4 w-4 rounded border-border" />
-                        <span className="text-sm text-text-primary">{t('orchestration.dawn.ieee80211v')}</span>
+                        <input type="checkbox" checked={usteerV} onChange={(e) => setUsteerV(e.target.checked)} className="h-4 w-4 rounded border-border" />
+                        <span className="text-sm text-text-primary">{t('orchestration.usteer.ieee80211v')}</span>
                       </label>
                       <label className="flex items-center gap-2">
-                        <input type="checkbox" checked={dawnBssTransition} onChange={(e) => setDawnBssTransition(e.target.checked)} className="h-4 w-4 rounded border-border" />
-                        <span className="text-sm text-text-primary">{t('orchestration.dawn.bssTransition')}</span>
+                        <input type="checkbox" checked={usteerBssTransition} onChange={(e) => setUsteerBssTransition(e.target.checked)} className="h-4 w-4 rounded border-border" />
+                        <span className="text-sm text-text-primary">{t('orchestration.usteer.bssTransition')}</span>
                       </label>
                       <label className="flex items-center gap-2">
-                        <input type="checkbox" checked={dawnFtPskGenerateLocal} onChange={(e) => setDawnFtPskGenerateLocal(e.target.checked)} className="h-4 w-4 rounded border-border" />
-                        <span className="text-sm text-text-primary">{t('orchestration.dawn.ftPskGenerateLocal')}</span>
+                        <input type="checkbox" checked={usteerFtPskGenerateLocal} onChange={(e) => setUsteerFtPskGenerateLocal(e.target.checked)} className="h-4 w-4 rounded border-border" />
+                        <span className="text-sm text-text-primary">{t('orchestration.usteer.ftPskGenerateLocal')}</span>
                       </label>
                       <label className="flex items-center gap-2">
-                        <input type="checkbox" checked={dawnFtOverDs} onChange={(e) => setDawnFtOverDs(e.target.checked)} className="h-4 w-4 rounded border-border" />
-                        <span className="text-sm text-text-primary">{t('orchestration.dawn.ftOverDs')}</span>
+                        <input type="checkbox" checked={usteerFtOverDs} onChange={(e) => setUsteerFtOverDs(e.target.checked)} className="h-4 w-4 rounded border-border" />
+                        <span className="text-sm text-text-primary">{t('orchestration.usteer.ftOverDs')}</span>
                       </label>
                     </div>
                   </div>

+ 88 - 36
app/src/pages/Roaming.tsx

@@ -3,44 +3,39 @@ import type { KeyboardEvent as ReactKeyboardEvent } from 'react'
 import { useTranslation } from 'react-i18next'
 import { Link } from 'react-router'
 import { motion, useReducedMotion } from 'framer-motion'
-import { AlertTriangle, ArrowDownToLine, ArrowUpFromLine, CheckCircle2, GitFork, History, RefreshCw, Wifi, XCircle } from 'lucide-react'
+import { AlertTriangle, ArrowDownToLine, ArrowUpFromLine, CheckCircle2, GitFork, History, RefreshCw, Wifi, X, XCircle } from 'lucide-react'
 import { cn, fetchJson } from '@/lib/utils'
 import { useNetPulse, redirectLogin } from '@/data/DataProvider'
 
 // ---------------------------------------------------------------------------
-// Tipos del contrato GET /api/dawn (server-go/internal/adapters/types.go).
-// Los clientes vienen del hearing map distribuido de DAWN: cada AP reporta
-// los clientes que ve con su señal, así que un mismo cliente puede aparecer
-// bajo varios BSSIDs (lo que pinta varias celdas en la matriz).
+// Tipos del contrato GET /api/usteer (server-go/internal/adapters/types.go).
 // ---------------------------------------------------------------------------
 
-interface DawnClient {
+interface UsteerClient {
   mac: string
   signal: number // -dBm
-  ht: boolean
-  vht: boolean
 }
-interface DawnAP {
+interface UsteerAP {
   ssid: string
   bssid: string
   hostname: string
   band: string
-  channel: number
+  freq: number
   utilizationPct: number
   clientCount: number
-  clients: DawnClient[]
+  clients: UsteerClient[]
   local: boolean
   iface: string
 }
-interface DawnMesh {
+interface UsteerMesh {
   routerId: string
   name: string
-  dawn: boolean
+  usteer: boolean
   apsSeen: number
 }
-interface Dawn {
-  aps: DawnAP[]
-  mesh: DawnMesh[]
+interface Usteer {
+  aps: UsteerAP[]
+  mesh: UsteerMesh[]
 }
 
 // ---------------------------------------------------------------------------
@@ -153,7 +148,7 @@ export default function Roaming() {
   const [tab, setTab] = useState<Tab>('matrix')
   const [band, setBand] = useState<Band>('all')
   const [weakOnly, setWeakOnly] = useState(false)
-  const [dawn, setDawn] = useState<Dawn | null>(null)
+  const [usteer, setUsteer] = useState<Usteer | null>(null)
   const [dot11r, setDot11r] = useState<Dot11rOverview | null>(null)
   const [dot11rLoading, setDot11rLoading] = useState(false)
   const [dot11rError, setDot11rError] = useState(false)
@@ -172,6 +167,8 @@ export default function Roaming() {
   const [error, setError] = useState(false)
   const [noApi, setNoApi] = useState(false)
   const [spin, setSpin] = useState(false)
+  const [kicking, setKicking] = useState<string | null>(null)
+  const [kickError, setKickError] = useState<string | null>(null)
 
   // MAC → nombre (resuelto desde la lista de dispositivos del overview).
   const nameByMac = useMemo(() => {
@@ -186,7 +183,7 @@ export default function Roaming() {
   // anterior en vuelo para que una respuesta vieja y lenta nunca sobrescriba
   // una más nueva (cambio de pestaña/rango o Refresh repetido). En unmount se
   // abortan todos.
-  const dawnAc = useRef<AbortController | null>(null)
+  const usteerAc = useRef<AbortController | null>(null)
   const dot11rAc = useRef<AbortController | null>(null)
   const surveyAc = useRef<AbortController | null>(null)
   const eventsAc = useRef<AbortController | null>(null)
@@ -194,24 +191,24 @@ export default function Roaming() {
   const spinTimer = useRef<number | null>(null)
 
   async function load() {
-    dawnAc.current?.abort()
+    usteerAc.current?.abort()
     const ac = new AbortController()
-    dawnAc.current = ac
+    usteerAc.current = ac
     setLoading(true)
     setError(false)
     setNoApi(false)
-    const result = await fetchJson<Dawn>('/api/dawn', { signal: ac.signal })
+    const result = await fetchJson<Usteer>('/api/usteer', { signal: ac.signal })
     if (ac.signal.aborted) return
     if (result.ok) {
-      setDawn(result.data)
+      setUsteer(result.data)
     } else if (result.kind === 'unauthorized') {
       redirectLogin()
     } else if (result.kind === 'no-api' && isDemo) {
       setNoApi(true)
-      setDawn(null)
+      setUsteer(null)
     } else {
       setError(true)
-      setDawn(null)
+      setUsteer(null)
     }
     setLoading(false)
   }
@@ -310,7 +307,7 @@ export default function Roaming() {
   }
 
   useEffect(() => () => {
-    dawnAc.current?.abort()
+    usteerAc.current?.abort()
     dot11rAc.current?.abort()
     surveyAc.current?.abort()
     eventsAc.current?.abort()
@@ -327,11 +324,40 @@ export default function Roaming() {
     }
   }, [tab])
 
+  // Expulsar a un cliente de su AP actual para forzar la reconexión
+  // (usteering manual cuando usteer no cambia al cliente).
+  async function kick(mac: string) {
+    if (kicking) return
+    setKicking(mac)
+    setKickError(null)
+    try {
+      const res = await fetch(`/api/usteer/${encodeURIComponent(mac)}/kick`, { method: 'POST' })
+      if (res.status === 401) redirectLogin()
+      if (!res.ok) {
+        let msg = t('roaming.kick.error')
+        try {
+          const j = (await res.json()) as { error?: string; message?: string }
+          if (j.message) msg = j.message
+          else if (j.error) msg = j.error
+        } catch { /* si el body no es JSON, usamos el mensaje por defecto */ }
+        setKickError(`${nameByMac.get(mac) ?? mac}: ${msg}`)
+        setKicking(null)
+        return
+      }
+      void load()
+      void loadEvents()
+    } catch {
+      setKickError(`${nameByMac.get(mac) ?? mac}: ${t('roaming.kick.error')}`)
+    } finally {
+      setKicking((cur) => (cur === mac ? null : cur))
+    }
+  }
+
   // APs visibles según el filtro de banda.
   const aps = useMemo(() => {
-    if (!dawn) return []
-    return dawn.aps.filter((a) => band === 'all' || a.band === band)
-  }, [dawn, band])
+    if (!usteer) return []
+    return usteer.aps.filter((a) => band === 'all' || a.band === band)
+  }, [usteer, band])
 
   // Filas = un cliente por MAC, con su señal vista desde cada AP (BSSID).
   const rows = useMemo(() => {
@@ -343,7 +369,7 @@ export default function Roaming() {
           r = { mac: c.mac, signals: new Map() }
           byMac.set(c.mac, r)
         }
-        // DAWN puede reportar la misma MAC varias veces bajo un BSSID; nos
+        // usteer puede reportar la misma MAC varias veces bajo un BSSID; nos
         // quedamos con la señal más fuerte (la medición más reciente/sana).
         const prev = r.signals.get(ap.bssid)
         if (prev === undefined || c.signal > prev) r.signals.set(ap.bssid, c.signal)
@@ -498,7 +524,7 @@ export default function Roaming() {
 
       {tab === 'matrix' && (
         <div role="tabpanel" id="panel-matrix" aria-labelledby="tab-matrix" tabIndex={0}>
-          {loading && (!dawn || aps.length === 0) && (
+          {loading && (!usteer || aps.length === 0) && (
             <div className="rounded-2xl border border-border bg-surface p-8 text-center text-caption text-text-muted">
               {t('roaming.loading')}
             </div>
@@ -513,19 +539,33 @@ export default function Roaming() {
               {t('roaming.error')}
             </div>
           )}
-          {!loading && !error && dawn && dawn.aps.length === 0 && (
+          {!loading && !error && usteer && usteer.aps.length === 0 && (
             <div className="rounded-2xl border border-border bg-surface p-8 text-center text-caption text-text-muted">
               {t('roaming.empty')}
             </div>
           )}
 
-          {!error && dawn && aps.length > 0 && (
+          {!error && usteer && aps.length > 0 && (
             <motion.section
               initial={initial}
               animate={{ opacity: 1, y: 0 }}
               transition={{ duration: 0.25, ease: 'easeOut', delay: 0.08 }}
               className="rounded-2xl border border-border bg-surface p-5 md:p-6"
             >
+              {kickError && (
+                <div className="mb-4 flex items-center gap-2 rounded-lg border border-danger/30 bg-danger/10 px-3 py-2 text-sm text-danger">
+                  <XCircle className="h-4 w-4 shrink-0" strokeWidth={1.75} />
+                  {kickError}
+                  <button
+                    type="button"
+                    onClick={() => setKickError(null)}
+                    className="ml-auto rounded p-1 hover:bg-danger/10"
+                    aria-label={t('common.close')}
+                  >
+                    <X className="h-3.5 w-3.5" strokeWidth={1.75} />
+                  </button>
+                </div>
+              )}
               {/* Título + filtros */}
               <div className="mb-4 flex flex-wrap items-start justify-between gap-3">
                 <div className="flex items-start gap-2">
@@ -584,7 +624,7 @@ export default function Roaming() {
                             <div className="flex flex-col gap-0.5">
                               <span className="font-medium text-text-primary">{ap.hostname}</span>
                               <span className="font-mono text-caption text-text-muted">
-                                {ap.band === '5 GHz' ? '5G' : '2.4G'} · ch{ap.channel}
+                                {ap.band === '5 GHz' ? '5G' : '2.4G'}
                               </span>
                             </div>
                           </th>
@@ -597,9 +637,21 @@ export default function Roaming() {
                         return (
                           <tr key={r.mac} className="group">
                             <th scope="row" className="sticky left-0 z-10 border-b border-border/60 bg-surface py-2 pr-3 text-left text-sm font-medium text-text-primary">
-                              <div className="flex flex-col">
-                                <span className="truncate">{name}</span>
-                                {name !== r.mac && <span className="font-mono text-caption text-text-muted">{r.mac}</span>}
+                              <div className="flex items-center justify-between gap-2">
+                                <div className="flex min-w-0 flex-col">
+                                  <span className="truncate">{name}</span>
+                                  {name !== r.mac && <span className="font-mono text-caption text-text-muted">{r.mac}</span>}
+                                </div>
+                                <button
+                                  type="button"
+                                  disabled={kicking === r.mac}
+                                  onClick={() => void kick(r.mac)}
+                                  title={t('roaming.kick.title')}
+                                  className="shrink-0 rounded-md p-1 text-text-muted opacity-0 transition-colors hover:bg-danger/10 hover:text-danger group-hover:opacity-100 focus:opacity-100 disabled:cursor-not-allowed disabled:opacity-50"
+                                  aria-label={t('roaming.kick.label', { name: nameByMac.get(r.mac) ?? r.mac })}
+                                >
+                                  <X className="h-4 w-4" strokeWidth={1.75} />
+                                </button>
                               </div>
                             </th>
                             {aps.map((ap) => {

+ 5 - 1
server-go/.env.example

@@ -28,7 +28,11 @@ WG_INTERFACE=wg0
 NETPULSE_AUTO_REARM=0
 NETPULSE_AUTO_REARM_COOLDOWN_S=600
 
-# --- Modo on-box (Fase 9) ---
+# --- Alertas de ghost port (#419) ---
+# 1 = activa alertas "Ghost port: X went silent". Default 0 (deshabilitado)
+# porque la deteccion sigue dando falsos positivos en algunos agentes.
+GHOST_PORT_ENABLED=0
+
 # 1 = servidor en el propio router: la config llega de /etc/config/netpulse
 # (sección server, mismas claves en minúscula: port, data_dir, auth_pass…),
 # AUTH_PASS es opcional (primer arranque: contraseña aleatoria en logread y

+ 3 - 3
server-go/internal/adapters/adapters_test.go

@@ -162,9 +162,9 @@ func TestDemoDetallePatioYFlint(t *testing.T) {
 	if none != nil || err != nil {
 		t.Fatalf("id desconocido: %v %v", none, err)
 	}
-	// Dawn/AdguardClients → (nil, nil) en demo
-	if dawn, err := d.GetDawn(context.Background()); dawn != nil || err != nil {
-		t.Fatalf("dawn demo: %v %v", dawn, err)
+	// Usteer/AdguardClients → (nil, nil) en demo
+	if usteer, err := d.GetUsteer(context.Background()); usteer != nil || err != nil {
+		t.Fatalf("usteer demo: %v %v", usteer, err)
 	}
 	if cl, err := d.GetAdguardClients(context.Background()); cl != nil || err != nil {
 		t.Fatalf("adguardClients demo: %v %v", cl, err)

+ 3 - 0
server-go/internal/adapters/agent.go

@@ -522,6 +522,9 @@ func (l *Live) polledFromAgent(cfg RouterConfig, p *probe.Payload) *routerPolled
 		// ruta SSH (issue #5 bug 1).
 		out.glClients = dd.GlClients
 	}
+	if p.Data.Arp != nil {
+		out.arp = p.Data.Arp
+	}
 	if fd := p.Data.FDB; fd != nil {
 		if fd.MACs != nil {
 			out.fdb = fd.MACs

+ 2 - 1
server-go/internal/adapters/agent_observe_dedup_test.go

@@ -8,6 +8,7 @@ import (
 	"testing"
 
 	"github.com/gnacho/netpulse/agent/probe"
+	"github.com/gnacho/netpulse/server-go/internal/config"
 )
 
 func ghostPayload(ts int64, rx, tx uint64) *probe.Payload {
@@ -20,7 +21,7 @@ func ghostPayload(ts int64, rx, tx uint64) *probe.Payload {
 }
 
 func TestPolledFromAgentDuplicatePayloadDoesNotObserve(t *testing.T) {
-	l := NewLive(nil, nil, []RouterConfig{{ID: "patio", Host: "192.168.8.2", Name: "Patio"}}, nil)
+	l := NewLive(&config.Config{GhostPortEnabled: true}, nil, []RouterConfig{{ID: "patio", Host: "192.168.8.2", Name: "Patio"}}, nil)
 	cfg := l.routers[0]
 
 	// Historia sana: 12 payloads nuevos con tráfico creciente.

+ 44 - 0
server-go/internal/adapters/arp_test.go

@@ -0,0 +1,44 @@
+// arp_test.go — Fallback de resolución IP vía tabla ARP (#377).
+package adapters
+
+import (
+	"testing"
+
+	"github.com/gnacho/netpulse/agent/probe"
+)
+
+func TestBuildDevicesArpFallback(t *testing.T) {
+	l := NewLive(nil, nil, nil, nil)
+	polled := map[string]*routerPolled{
+		"patio": {
+			cfg: RouterConfig{ID: "patio", Name: "Patio", Host: "192.168.1.2"},
+			wireless: map[string]WirelessClient{
+				"AA:BB:CC:DD:EE:FF": {SignalDbm: -55, Band: "5 GHz"},
+			},
+			arp: map[string]string{
+				"AA:BB:CC:DD:EE:FF": "192.168.1.50",
+			},
+		},
+	}
+	devs := l.buildDevices(polled)
+	if len(devs) != 1 {
+		t.Fatalf("esperado 1 dispositivo, got %d: %+v", len(devs), devs)
+	}
+	if devs[0].IP != "192.168.1.50" {
+		t.Fatalf("IP esperada 192.168.1.50, got %q (dispositivo %+v)", devs[0].IP, devs[0])
+	}
+}
+
+func TestPolledFromAgentArp(t *testing.T) {
+	l := NewLive(nil, nil, nil, nil)
+	pl := &probe.Payload{Router: "patio", Version: "0.1.0"}
+	pl.Data.System = &probe.SystemData{SysInfo: &probe.SysInfo{Uptime: 100}}
+	pl.Data.Arp = map[string]string{"AA:BB:CC:DD:EE:FF": "192.168.1.50"}
+	p := l.polledFromAgent(RouterConfig{ID: "patio"}, pl)
+	if p == nil {
+		t.Fatal("polledFromAgent devolvió nil")
+	}
+	if p.arp["AA:BB:CC:DD:EE:FF"] != "192.168.1.50" {
+		t.Fatalf("arp no propagada: %+v", p.arp)
+	}
+}

+ 0 - 154
server-go/internal/adapters/dawn_test.go

@@ -1,154 +0,0 @@
-package adapters
-
-import (
-	"encoding/json"
-	"testing"
-)
-
-// TestDawnAPsFromNetwork parsea una salida sintética de `ubus call dawn
-// get_network` (mismo formato que producción) y verifica APs + hearing map.
-func TestDawnAPsFromNetwork(t *testing.T) {
-	// Un SSID con dos APs y clientes vistos por cada uno (hearing map). El
-	// mismo cliente (AA:BB:...) aparece bajo dos BSSIDs: DAWN lo reporta desde
-	// cada AP que lo ve. Un segundo SSID sin clientes. Un objeto sin "channel"
-	// (ruido) que debe ignorarse.
-	raw := `{
-		"home": {
-			"AA:11:BB:22:CC:01": {
-				"channel": 1,
-				"freq": 2412,
-				"channel_utilization": 70,
-				"num_sta": 2,
-				"ht_support": true,
-				"vht_support": false,
-				"local": true,
-				"iface": "wlan0",
-				"hostname": "ap-living",
-				"AA:BB:CC:DD:00:01": {"signal": -40, "ht": true, "vht": false},
-				"AA:BB:CC:DD:00:02": {"signal": -81, "ht": false, "vht": false}
-			},
-			"AA:11:BB:22:CC:02": {
-				"channel": 36,
-				"freq": 5180,
-				"channel_utilization": 6,
-				"num_sta": 1,
-				"ht_support": true,
-				"vht_support": true,
-				"local": false,
-				"iface": "wlan1",
-				"hostname": "ap-living",
-				"AA:BB:CC:DD:00:01": {"signal": -55, "ht": true, "vht": true}
-			}
-		},
-		"guest": {
-			"AA:11:BB:22:CC:03": {
-				"channel": 6,
-				"freq": 2437,
-				"channel_utilization": 20,
-				"num_sta": 0,
-				"local": true,
-				"iface": "phy1-ap1",
-				"hostname": "ap-guest"
-			}
-		}
-	}`
-	var data map[string]map[string]json.RawMessage
-	if err := json.Unmarshal([]byte(raw), &data); err != nil {
-		t.Fatalf("unmarshal fixture: %v", err)
-	}
-
-	aps := dawnAPsFromNetwork(data)
-	if len(aps) != 3 {
-		t.Fatalf("esperaba 3 APs, obtuvo %d", len(aps))
-	}
-
-	// Orden: hostname asc, luego banda. ap-guest (2.4) < ap-living (2.4) < ap-living (5).
-	want := []struct {
-		host, band string
-		ch         int
-		util       float64
-		count      int
-		nClients   int
-	}{
-		{"ap-guest", "2.4 GHz", 6, 20, 0, 0},
-		{"ap-living", "2.4 GHz", 1, 70, 2, 2},
-		{"ap-living", "5 GHz", 36, 6, 1, 1},
-	}
-	for i, w := range want {
-		ap := aps[i]
-		if ap.Hostname != w.host || ap.Band != w.band {
-			t.Errorf("AP[%d] = %s %s, queria %s %s", i, ap.Hostname, ap.Band, w.host, w.band)
-		}
-		if ap.Channel != w.ch {
-			t.Errorf("AP[%d] channel = %d, queria %d", i, ap.Channel, w.ch)
-		}
-		if ap.UtilizationPct != w.util {
-			t.Errorf("AP[%d] util = %v, queria %v", i, ap.UtilizationPct, w.util)
-		}
-		if ap.ClientCount != w.count {
-			t.Errorf("AP[%d] clientCount = %d, queria %d", i, ap.ClientCount, w.count)
-		}
-		if len(ap.Clients) != w.nClients {
-			t.Errorf("AP[%d] clients = %d, queria %d", i, len(ap.Clients), w.nClients)
-		}
-	}
-
-	// El cliente AA:BB:CC:DD:00:01 aparece bajo dos APs (hearing map): señal
-	// -40 desde el 2.4 del living y -55 desde el 5.
-	living24 := aps[1]
-	if living24.SSID != "home" || living24.BSSID != "AA:11:BB:22:CC:01" {
-		t.Fatalf("AP living 2.4 inesperado: %+v", living24)
-	}
-	sig := map[string]int{}
-	for _, c := range living24.Clients {
-		sig[c.MAC] = c.Signal
-	}
-	if sig["AA:BB:CC:DD:00:01"] != -40 {
-		t.Errorf("señal cliente 01 desde living 2.4 = %d, queria -40", sig["AA:BB:CC:DD:00:01"])
-	}
-	if sig["AA:BB:CC:DD:00:02"] != -81 {
-		t.Errorf("señal cliente 02 desde living 2.4 = %d, queria -81", sig["AA:BB:CC:DD:00:02"])
-	}
-	living5 := aps[2]
-	sig5 := map[string]int{}
-	for _, c := range living5.Clients {
-		sig5[c.MAC] = c.Signal
-	}
-	if sig5["AA:BB:CC:DD:00:01"] != -55 {
-		t.Errorf("señal cliente 01 desde living 5 = %d, queria -55", sig5["AA:BB:CC:DD:00:01"])
-	}
-
-	// MAC normalizada a mayúsculas.
-	for _, c := range living24.Clients {
-		if c.MAC != upperMAC(c.MAC) {
-			t.Errorf("MAC no normalizada: %s", c.MAC)
-		}
-	}
-
-	// clients nunca nil (serializa [] en JSON, no null): el frontend itera sin
-	// guardarse de null.
-	guest := aps[0] // ap-guest, sin clientes
-	if guest.Clients == nil {
-		t.Fatalf("AP sin clientes tiene Clients nil; debe ser []")
-	}
-}
-
-func upperMAC(s string) string {
-	out := make([]byte, len(s))
-	for i := 0; i < len(s); i++ {
-		c := s[i]
-		if c >= 'a' && c <= 'z' {
-			c -= 32
-		}
-		out[i] = c
-	}
-	return string(out)
-}
-
-// TestDawnAPsFromNetworkVacio: sin datos → slice vacío (no nil en JSON).
-func TestDawnAPsFromNetworkVacio(t *testing.T) {
-	aps := dawnAPsFromNetwork(map[string]map[string]json.RawMessage{})
-	if len(aps) != 0 {
-		t.Fatalf("esperaba 0 APs, obtuvo %d", len(aps))
-	}
-}

+ 5 - 1
server-go/internal/adapters/demo.go

@@ -9,6 +9,7 @@ package adapters
 
 import (
 	"context"
+	"errors"
 	"math"
 	"math/rand"
 	"sort"
@@ -185,7 +186,10 @@ func (d *Demo) Mode() string              { return "demo" }
 func (d *Demo) SetRouters([]RouterConfig) {} // la demo ignora la configuración
 func (d *Demo) Close() error              { return nil }
 
-func (d *Demo) GetDawn(context.Context) (*Dawn, error) { return nil, nil }
+func (d *Demo) GetUsteer(context.Context) (*Usteer, error) { return nil, nil }
+
+// KickUsteerClient no-op en demo.
+func (d *Demo) KickUsteerClient(context.Context, string) error { return errors.New("not available in demo") }
 
 func (d *Demo) GetDot11r(context.Context) (*Dot11rOverview, error) { return nil, nil }
 

+ 208 - 120
server-go/internal/adapters/live.go

@@ -105,6 +105,9 @@ type routerPolled struct {
 	// leases. Se usa SOLO para resolver IPs de dispositivos ya conocidos que
 	// salen sin IP (dnsmasq sin lease), nunca para crear dispositivos nuevos.
 	glClients []DhcpLease
+	// arp: MAC→IP de /proc/net/arp (#377). Último recurso de resolución de
+	// IP cuando ni el lease ni gl-clients la tienen (DHCP en otro equipo).
+	arp       map[string]string
 	wireless  map[string]WirelessClient
 	ports     []EthPort
 	radios    []Radio
@@ -224,12 +227,12 @@ type Live struct {
 	// presencePruneAfter: ticks sin verse que eliminan la MAC de los mapas
 	// (dispositivo que se fue para siempre; ~2h a 5s/tick, issue #206).
 	presencePruneAfter int
-	// dawnAvailable: cache de "¿hay DAWN en algún router?" para el flag del
+	// usteerAvailable: cache de "¿hay usteer en algún router?" para el flag del
 	// overview (entrada /roaming). Refrescado asíncronamente (TTL 30s, 1 SSH
-	// al gateway) por dawnAvailableCached para no bloquear buildOverview.
-	dawnAvailable  bool
-	dawnCheckedAt  time.Time
-	dawnChecking   bool
+	// al gateway) por usteerAvailableCached para no bloquear buildOverview.
+	usteerAvailable bool
+	usteerCheckedAt time.Time
+	usteerChecking  bool
 	seenOnlineMacs bool
 	wanDown        map[string]int
 	backhaulCache  map[string]backhaulCacheEntry
@@ -320,7 +323,7 @@ func NewLive(cfg *config.Config, d *db.DB, initial []RouterConfig, pool *SSHPool
 		agentOutdatedAlerted: map[string]bool{},
 		routerMacs:           map[string]string{},
 		sshAuthFailAlerted:   map[string]bool{},
-		portMon:              NewPortMonitor(),
+		portMon:              NewPortMonitor(cfg != nil && cfg.GhostPortEnabled),
 		suppression:         alerts.NewSuppressionGraph(),
 	}
 	l.loadRouterMacs()
@@ -838,6 +841,7 @@ func (l *Live) pollRouter(ctx context.Context, cfg RouterConfig) (*routerPolled,
 		net = &NetDevBps{}
 	}
 	leases := client.GetDhcpLeases()
+	arp := client.GetArp()
 	// gl-clients (GL.iNet): complementa la resolución de IP donde dnsmasq no
 	// tiene lease (issue #5 bug 1). En routers sin el objeto ubus sale vacío
 	// — coste: una llamada ubus local por poll.
@@ -931,7 +935,7 @@ func (l *Live) pollRouter(ctx context.Context, cfg RouterConfig) (*routerPolled,
 	return &routerPolled{
 		cfg: cfg, client: client, sysInfo: sysInfo, board: board,
 		cpu: cpuV, ram: ramPct, temp: tempV,
-		uptimeSec: sysInfo.Uptime, net: net, leases: leases, glClients: glClients,
+		uptimeSec: sysInfo.Uptime, net: net, leases: leases, arp: arp, glClients: glClients,
 		wireless: wirelessGood, ports: portsGood, radios: radiosGood,
 		fdb: fdbGood, brMac: brMac, latencyMs: latencyMs, lossPct: lossPct,
 		backhaul: backhaul, lldp: lldp, lldpUnavailable: lldpUnavailable,
@@ -1635,8 +1639,12 @@ func (l *Live) pollWireGuard(devices []Device) *WireGuardStats {
 // FDB gateway si no hay memoria) + device_attrib (index.js:396-460).
 func (l *Live) buildDevices(polled map[string]*routerPolled) []Device {
 	leasesByMac := map[string]DhcpLease{}
+	arpByMac := map[string]string{}
 	glByMac := map[string]DhcpLease{}
 	for _, p := range polled {
+		for mac, ip := range p.arp {
+			arpByMac[mac] = ip
+		}
 		for _, le := range p.leases {
 			if le.MAC != "" {
 				leasesByMac[le.MAC] = le
@@ -1864,17 +1872,24 @@ func (l *Live) buildDevices(polled map[string]*routerPolled) []Device {
 			d.IP = lease.IP
 		} else {
 			d.Name = mac
-			// Fallback gl-clients (GL.iNet): el cliente no tiene lease pero el
-			// firmware sí conoce su IP (y a veces nombre). (issue #5 bug 1)
-			if gl, ok := glByMac[mac]; ok {
-				d.IP = gl.IP
-				if gl.Hostname != "" {
-					d.Name = gl.Hostname
-				}
+		// Fallback gl-clients (GL.iNet): el cliente no tiene lease pero el
+		// firmware sí conoce su IP (y a veces nombre). (issue #5 bug 1)
+		if gl, ok := glByMac[mac]; ok {
+			d.IP = gl.IP
+			if gl.Hostname != "" {
+				d.Name = gl.Hostname
 			}
 		}
-		// issue #196: la allowlist manda sobre el nombre por defecto. Con
-		// alias (Name != MAC) el dispositivo deja de ser "desconocido".
+	}
+	// Fallback ARP (#377): el DHCP vive en otro equipo, pero cualquier
+	// router de la flota que enrute la LAN conoce la MAC→IP.
+	if d.IP == "" {
+		if ip, ok := arpByMac[mac]; ok {
+			d.IP = ip
+		}
+	}
+	// issue #196: la allowlist manda sobre el nombre por defecto. Con
+	// alias (Name != MAC) el dispositivo deja de ser "desconocido".
 		if alias, ok := knownMacs[mac]; ok && alias != "" {
 			d.Name = alias
 		}
@@ -2205,21 +2220,21 @@ func (l *Live) buildOverview(ctx context.Context) (*Overview, error) {
 		DistributionNodes: distNodes,
 		Topology:          BuildTopoSemantics(routerList, devices, wgStats, distNodes), // SPEC-65 D65-3
 		Devices:           devices,
-		Dawn:              &DawnOverview{Available: l.dawnAvailableCached()},
+		Usteer:            &UsteerOverview{Available: l.usteerAvailableCached()},
 		VM:                ViewModelVersion, // SPEC-65 D65-4
 		Ts:                time.Now().Unix(),
 	}, nil
 }
 
-// dawnAvailableCached devuelve si hay DAWN en la red (cacheado). Lanza un
+// usteerAvailableCached devuelve si hay usteer en la red (cacheado). Lanza un
 // refresco asíncrono (1 SSH al gateway, TTL 30s) cuando el cache está stale,
 // sin bloquear el overview: la primera llamada devuelve false y el flag llega
 // en el overview siguiente una vez refrescado.
-func (l *Live) dawnAvailableCached() bool {
+func (l *Live) usteerAvailableCached() bool {
 	l.mu.Lock()
-	avail := l.dawnAvailable
-	checked := l.dawnCheckedAt
-	checking := l.dawnChecking
+	avail := l.usteerAvailable
+	checked := l.usteerCheckedAt
+	checking := l.usteerChecking
 	gw := l.gatewayCfg
 	l.mu.Unlock()
 	if gw == nil {
@@ -2229,15 +2244,15 @@ func (l *Live) dawnAvailableCached() bool {
 		return avail
 	}
 	l.mu.Lock()
-	l.dawnChecking = true
+	l.usteerChecking = true
 	host := gw.Host
 	l.mu.Unlock()
 	go func() {
-		out, err := l.pool.Run(host, "ubus call dawn get_network", 4*time.Second)
+		out, err := l.pool.Run(host, "ubus call usteer local_info", 4*time.Second)
 		l.mu.Lock()
-		l.dawnChecking = false
-		l.dawnCheckedAt = time.Now()
-		l.dawnAvailable = err == nil && len(out) > 10
+		l.usteerChecking = false
+		l.usteerCheckedAt = time.Now()
+		l.usteerAvailable = err == nil && strings.TrimSpace(out) != ""
 		l.mu.Unlock()
 	}()
 	return avail
@@ -2668,134 +2683,207 @@ func (l *Live) GetAdguardClients(ctx context.Context) ([]AdguardClient, error) {
 	return gl.QueryClients(ctx)
 }
 
-// dawnAPField es el conjunto de keys escalares que describen un AP en la
-// salida de `ubus call dawn get_network`. El resto de keys de un BSSID cuyo
-// valor es un objeto (con "signal") son clientes del hearing map.
-var dawnAPField = map[string]bool{
-	"channel": true, "freq": true, "channel_utilization": true,
-	"num_sta": true, "ht_support": true, "vht_support": true,
-	"local": true, "iface": true, "hostname": true,
-	"neighbor_report": true, "op_class": true,
+// usteerAPRaw es la forma cruda de una entrada de `ubus call usteer
+// local_info` / `remote_info` (por iface o ip#iface).
+type usteerAPRaw struct {
+	BSSID  string `json:"bssid"`
+	SSID   string `json:"ssid"`
+	Freq   int    `json:"freq"`
+	NAssoc int    `json:"n_assoc"`
+	Load   int    `json:"load"`
+}
+
+// usteerClientRaw es la forma cruda de una entrada de `ubus call usteer
+// connected_clients` (por MAC).
+type usteerClientRaw struct {
+	Signal int `json:"signal"`
 }
 
-// GetDawn: red DAWN (roaming/band-steering). nil si ningún router responde.
+// GetUsteer: red usteer (roaming/steering). nil si ningún router responde.
 //
-// La salida de `ubus call dawn get_network` mezcla, por cada BSSID, los campos
-// del AP (escalares) con los clientes anidados (MAC → {signal, ht, vht, ...}).
-// DAWN distribuye el hearing map entre nodos, así que la respuesta del primer
-// router que contesta ya contiene toda la malla (APs + clientes vistos por
-// cada uno). Por eso solo usamos firstData.
-func (l *Live) GetDawn(context.Context) (*Dawn, error) {
+// A diferencia de DAWN (que distribuía el hearing map en get_network), usteer
+// expone `local_info` por router (los APs propios) y `connected_clients` por
+// iface. Se sondea cada router con SSH (local_info + connected_clients) y se
+// agregan sus APs locales; el mesh marca por router si usteer está activo y
+// cuántos APs ve. Los clientes se asocian a cada AP por nombre de iface.
+func (l *Live) GetUsteer(context.Context) (*Usteer, error) {
 	l.mu.Lock()
 	routers := append([]RouterConfig(nil), l.routers...)
 	l.mu.Unlock()
 
-	var firstData map[string]map[string]json.RawMessage
-	mesh := []DawnMesh{}
+	aps := []UsteerAP{}
+	mesh := []UsteerMesh{}
 	for _, cfg := range routers {
 		name := cfg.Name
 		if name == "" {
 			name = cfg.ID
 		}
-		// Los routers agent-only (switches sin SSH, p.ej. switch16) no tienen
-		// DAWN: saltar el SSH evita un timeout de probeTimeout (4s) por cada
-		// llamada a GetDawn. Aparecen en el mesh como Dawn=false para que la
-		// UI siga mostrándolos en la tabla.
 		if cfg.AgentOnly {
-			mesh = append(mesh, DawnMesh{RouterID: cfg.ID, Name: name, Dawn: false, ApsSeen: 0})
+			mesh = append(mesh, UsteerMesh{RouterID: cfg.ID, Name: name, Usteer: false, ApsSeen: 0})
 			continue
 		}
-		out, err := l.pool.Run(cfg.Host, "ubus call dawn get_network", 0)
+		localOut, err := l.pool.Run(cfg.Host, "ubus call usteer local_info", 0)
 		if err != nil {
-			mesh = append(mesh, DawnMesh{RouterID: cfg.ID, Name: name, Dawn: false, ApsSeen: 0})
+			mesh = append(mesh, UsteerMesh{RouterID: cfg.ID, Name: name, Usteer: false, ApsSeen: 0})
 			continue
 		}
-		var data map[string]map[string]json.RawMessage
-		if json.Unmarshal([]byte(out), &data) != nil {
-			mesh = append(mesh, DawnMesh{RouterID: cfg.ID, Name: name, Dawn: false, ApsSeen: 0})
+		var local map[string]usteerAPRaw
+		if json.Unmarshal([]byte(localOut), &local) != nil {
+			mesh = append(mesh, UsteerMesh{RouterID: cfg.ID, Name: name, Usteer: false, ApsSeen: 0})
 			continue
 		}
-		if firstData == nil {
-			firstData = data
-		}
+		clientsOut, _ := l.pool.Run(cfg.Host, "ubus call usteer connected_clients", 0)
+		clientsByIface := map[string]map[string]usteerClientRaw{}
+		_ = json.Unmarshal([]byte(clientsOut), &clientsByIface)
+
 		seen := 0
-		for _, bssids := range data {
-			seen += len(bssids)
+		for iface, raw := range local {
+			if raw.SSID == "" || raw.BSSID == "" {
+				continue
+			}
+			aps = append(aps, buildUsteerAPWithClients(iface, raw, clientsByIface[iface], name, true))
+			seen++
 		}
-		mesh = append(mesh, DawnMesh{RouterID: cfg.ID, Name: name, Dawn: true, ApsSeen: seen})
+		mesh = append(mesh, UsteerMesh{RouterID: cfg.ID, Name: name, Usteer: true, ApsSeen: seen})
 	}
-	if firstData == nil {
+	if len(aps) == 0 {
 		return nil, nil
 	}
-	aps := dawnAPsFromNetwork(firstData)
-	return &Dawn{APs: aps, Mesh: mesh}, nil
+	return &Usteer{APs: aps, Mesh: mesh}, nil
 }
 
-// dawnAPsFromNetwork parsea la salida de `ubus call dawn get_network` ya
-// deserializada a json.RawMessage (SSID → BSSID → campos mixtos). Devuelve los
-// APs con sus clientes del hearing map. Función pura para testear sin SSH.
-func dawnAPsFromNetwork(firstData map[string]map[string]json.RawMessage) []DawnAP {
-	aps := []DawnAP{}
-	for ssid, bssids := range firstData {
-		for bssid, raw := range bssids {
-			var fields map[string]json.RawMessage
-			if json.Unmarshal(raw, &fields) != nil {
-				continue
-			}
-			// "channel" presente y no cero → es un AP (no un cliente suelto).
-			chRaw, ok := fields["channel"]
-			if !ok {
-				continue
+// sshRunner es el subconjunto de *SSHPool que usan las funciones live que
+// ejecutan comandos remotos. Permite inyectar runners falsos en tests.
+type sshRunner interface {
+	Run(host, cmd string, timeout time.Duration) (string, error)
+}
+
+// KickUsteerClient busca la MAC en los connected_clients de cada router y la
+// expulsa del AP hostapd donde esté conectada. El motivo 5 (DISASSOC_DUE_TO_BSS_TRANSITION_PROHIBITED)
+// con deauth=true fuerza al cliente a reasociarse; ban_time corto (120 ms) evita
+// que vuelva inmediatamente al mismo AP sin impedir la reconexión normal.
+//
+// Si el cliente aparece en varios routers (transición de roaming) o un
+// del_client falla por un estado transitorio del AP, intenta expulsarlo de
+// cada uno hasta que un intento tenga éxito. Solo devuelve error cuando el
+// cliente no está en ningún router o cuando todos los intentos fallan.
+func (l *Live) KickUsteerClient(ctx context.Context, mac string) error {
+	target := strings.ToUpper(strings.TrimSpace(mac))
+	if target == "" || !validMAC(target) {
+		return fmt.Errorf("invalid MAC")
+	}
+	l.mu.Lock()
+	routers := append([]RouterConfig(nil), l.routers...)
+	l.mu.Unlock()
+
+	return kickUsteerClient(target, routers, l.pool)
+}
+
+func kickUsteerClient(target string, routers []RouterConfig, runner sshRunner) error {
+	var failures []string
+
+	for _, cfg := range routers {
+		if cfg.AgentOnly {
+			continue
+		}
+		out, err := runner.Run(cfg.Host, "ubus call usteer connected_clients", 0)
+		if err != nil {
+			continue
+		}
+		var clients map[string]map[string]usteerClientRaw
+		if err := json.Unmarshal([]byte(out), &clients); err != nil {
+			continue
+		}
+		for iface, macs := range clients {
+			var found bool
+			for m := range macs {
+				if strings.ToUpper(m) == target {
+					found = true
+					break
+				}
 			}
-			var channel int
-			json.Unmarshal(chRaw, &channel)
-			if channel == 0 {
+			if !found {
 				continue
 			}
-			ap := DawnAP{SSID: ssid, BSSID: bssid, Channel: channel, Clients: []DawnClient{}}
-			var freq float64
-			json.Unmarshal(fields["freq"], &freq)
-			json.Unmarshal(fields["channel_utilization"], &ap.UtilizationPct)
-			json.Unmarshal(fields["num_sta"], &ap.ClientCount)
-			json.Unmarshal(fields["local"], &ap.Local)
-			json.Unmarshal(fields["iface"], &ap.Iface)
-			json.Unmarshal(fields["hostname"], &ap.Hostname)
-			if freq >= 5000 {
-				ap.Band = "5 GHz"
-			} else {
-				ap.Band = "2.4 GHz"
-			}
-			// Clientes anidados: cualquier key MAC cuyo valor sea un objeto
-			// con "signal" negativa (en -dBm).
-			for mac, valRaw := range fields {
-				if dawnAPField[mac] {
-					continue
-				}
-				s := strings.TrimSpace(string(valRaw))
-				if !strings.HasPrefix(s, "{") {
-					continue
-				}
-				var c struct {
-					Signal int  `json:"signal"`
-					HT     bool `json:"ht"`
-					VHT    bool `json:"vht"`
-				}
-				if json.Unmarshal(valRaw, &c) == nil && c.Signal < 0 {
-					ap.Clients = append(ap.Clients, DawnClient{
-						MAC: strings.ToUpper(mac), Signal: c.Signal, HT: c.HT, VHT: c.VHT,
-					})
+			cmd := fmt.Sprintf("ubus call %s del_client '{\"addr\":\"%s\",\"reason\":5,\"deauth\":true,\"ban_time\":120000}'", iface, target)
+			if _, err := runner.Run(cfg.Host, cmd, 0); err != nil {
+				name := cfg.Name
+				if name == "" {
+					name = cfg.Host
 				}
+				failures = append(failures, name)
+				continue
 			}
-			aps = append(aps, ap)
+			return nil
 		}
 	}
-	sort.Slice(aps, func(i, j int) bool {
-		if aps[i].Hostname != aps[j].Hostname {
-			return aps[i].Hostname < aps[j].Hostname
+
+	if len(failures) > 0 {
+		return fmt.Errorf("could not disconnect from %s", strings.Join(failures, "; "))
+	}
+	return fmt.Errorf("client not found")
+}
+
+// validMAC acepta MAC con separadores ':' o '-'.
+func validMAC(s string) bool {
+	parts := strings.Split(s, ":")
+	if len(parts) != 6 {
+		parts = strings.Split(s, "-")
+	}
+	if len(parts) != 6 {
+		return false
+	}
+	for _, p := range parts {
+		if len(p) != 2 {
+			return false
 		}
-		return aps[i].Band < aps[j].Band
-	})
-	return aps
+		for i := 0; i < len(p); i++ {
+			c := p[i]
+			if !((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) {
+				return false
+			}
+		}
+	}
+	return true
+}
+
+// buildUsteerAP construye un UsteerAP desde una entrada cruda de local_info.
+// Band se deriva de freq (>= 5000 MHz → 5 GHz). Función pura para testear.
+func buildUsteerAP(iface string, raw usteerAPRaw, hostname string, local bool) UsteerAP {
+	band := "2.4 GHz"
+	if raw.Freq >= 5000 {
+		band = "5 GHz"
+	}
+	return UsteerAP{
+		SSID:           raw.SSID,
+		BSSID:          strings.ToUpper(raw.BSSID),
+		Hostname:       hostname,
+		Band:           band,
+		Freq:           raw.Freq,
+		UtilizationPct: raw.Load,
+		ClientCount:    raw.NAssoc,
+		Clients:        []UsteerClient{},
+		Local:          local,
+		Iface:          iface,
+	}
+}
+
+// buildUsteerAPWithClients enriquece un AP con los clientes de
+// connected_clients para ese mismo iface. Los clientes se ordenan por MAC
+// para respuestas deterministas.
+func buildUsteerAPWithClients(iface string, raw usteerAPRaw, clients map[string]usteerClientRaw, hostname string, local bool) UsteerAP {
+	ap := buildUsteerAP(iface, raw, hostname, local)
+	for mac, c := range clients {
+		if c.Signal >= 0 {
+			continue // señal 0/positiva = sin datos
+		}
+		ap.Clients = append(ap.Clients, UsteerClient{
+			MAC:    strings.ToUpper(mac),
+			Signal: c.Signal,
+		})
+	}
+	sort.Slice(ap.Clients, func(i, j int) bool { return ap.Clients[i].MAC < ap.Clients[j].MAC })
+	return ap
 }
 
 // ---------------------------------------------------------------------------

+ 117 - 0
server-go/internal/adapters/live_kick_test.go

@@ -0,0 +1,117 @@
+package adapters
+
+import (
+	"errors"
+	"fmt"
+	"testing"
+	"time"
+)
+
+type fakeKickRunner struct {
+	calls     []struct{ host, cmd string }
+	responses map[string]string
+	errors    map[string]error
+}
+
+func (f *fakeKickRunner) Run(host, cmd string, timeout time.Duration) (string, error) {
+	f.calls = append(f.calls, struct{ host, cmd string }{host, cmd})
+	key := host + "|" + cmd
+	if e, ok := f.errors[key]; ok {
+		return "", e
+	}
+	return f.responses[key], nil
+}
+
+func TestKickUsteerClient_Success(t *testing.T) {
+	runner := &fakeKickRunner{
+		responses: map[string]string{
+			"192.168.1.2|ubus call usteer connected_clients": `{"hostapd.phy1-ap0":{"38:c6:ce:2f:06:5a":{"signal":-50}}}`,
+			fmt.Sprintf("192.168.1.2|ubus call hostapd.phy1-ap0 del_client '%s'", `{"addr":"38:C6:CE:2F:06:5A","reason":5,"deauth":true,"ban_time":120000}`): "",
+		},
+	}
+	routers := []RouterConfig{{ID: "rt2", Name: "rt2", Host: "192.168.1.2"}}
+	if err := kickUsteerClient("38:C6:CE:2F:06:5A", routers, runner); err != nil {
+		t.Fatalf("unexpected error: %v", err)
+	}
+	if len(runner.calls) != 2 {
+		t.Fatalf("expected 2 calls, got %d", len(runner.calls))
+	}
+}
+
+func TestKickUsteerClient_ClientNotFound(t *testing.T) {
+	runner := &fakeKickRunner{
+		responses: map[string]string{
+			"192.168.1.2|ubus call usteer connected_clients": `{"hostapd.phy1-ap0":{}}`,
+		},
+	}
+	routers := []RouterConfig{{ID: "rt2", Name: "rt2", Host: "192.168.1.2"}}
+	err := kickUsteerClient("38:C6:CE:2F:06:5A", routers, runner)
+	if err == nil || err.Error() != "client not found" {
+		t.Fatalf("expected 'client not found', got: %v", err)
+	}
+}
+
+func TestKickUsteerClient_ContinuesAfterFailure(t *testing.T) {
+	runner := &fakeKickRunner{
+		responses: map[string]string{
+			"192.168.1.2|ubus call usteer connected_clients": `{"hostapd.phy1-ap0":{"38:c6:ce:2f:06:5a":{"signal":-50}}}`,
+			"192.168.1.3|ubus call usteer connected_clients": `{"hostapd.phy1-ap0":{"38:c6:ce:2f:06:5a":{"signal":-60}}}`,
+			fmt.Sprintf("192.168.1.3|ubus call hostapd.phy1-ap0 del_client '%s'", `{"addr":"38:C6:CE:2F:06:5A","reason":5,"deauth":true,"ban_time":120000}`): "",
+		},
+		errors: map[string]error{
+			fmt.Sprintf("192.168.1.2|ubus call hostapd.phy1-ap0 del_client '%s'", `{"addr":"38:C6:CE:2F:06:5A","reason":5,"deauth":true,"ban_time":120000}`): errors.New("boom"),
+		},
+	}
+	routers := []RouterConfig{
+		{ID: "rt2", Name: "rt2", Host: "192.168.1.2"},
+		{ID: "rt3", Name: "rt3", Host: "192.168.1.3"},
+	}
+	if err := kickUsteerClient("38:C6:CE:2F:06:5A", routers, runner); err != nil {
+		t.Fatalf("unexpected error: %v", err)
+	}
+	if len(runner.calls) != 4 {
+		t.Fatalf("expected 4 calls, got %d", len(runner.calls))
+	}
+}
+
+func TestKickUsteerClient_AllRoutersFail(t *testing.T) {
+	runner := &fakeKickRunner{
+		responses: map[string]string{
+			"192.168.1.2|ubus call usteer connected_clients": `{"hostapd.phy1-ap0":{"38:c6:ce:2f:06:5a":{"signal":-50}}}`,
+		},
+		errors: map[string]error{
+			fmt.Sprintf("192.168.1.2|ubus call hostapd.phy1-ap0 del_client '%s'", `{"addr":"38:C6:CE:2F:06:5A","reason":5,"deauth":true,"ban_time":120000}`): errors.New("boom"),
+		},
+	}
+	routers := []RouterConfig{{ID: "rt2", Name: "rt2", Host: "192.168.1.2"}}
+	err := kickUsteerClient("38:C6:CE:2F:06:5A", routers, runner)
+	if err == nil {
+		t.Fatalf("expected error")
+	}
+	want := "could not disconnect from rt2"
+	if err.Error() != want {
+		t.Fatalf("expected %q, got %q", want, err.Error())
+	}
+}
+
+func TestKickUsteerClient_ConnectedClientsFails(t *testing.T) {
+	runner := &fakeKickRunner{
+		responses: map[string]string{
+			"192.168.1.3|ubus call usteer connected_clients": `{"hostapd.phy1-ap0":{"38:c6:ce:2f:06:5a":{"signal":-50}}}`,
+			fmt.Sprintf("192.168.1.3|ubus call hostapd.phy1-ap0 del_client '%s'", `{"addr":"38:C6:CE:2F:06:5A","reason":5,"deauth":true,"ban_time":120000}`): "",
+		},
+		errors: map[string]error{
+			"192.168.1.2|ubus call usteer connected_clients": errors.New("ssh timeout"),
+		},
+	}
+	routers := []RouterConfig{
+		{ID: "rt2", Name: "rt2", Host: "192.168.1.2"},
+		{ID: "rt3", Name: "rt3", Host: "192.168.1.3"},
+	}
+	if err := kickUsteerClient("38:C6:CE:2F:06:5A", routers, runner); err != nil {
+		t.Fatalf("unexpected error: %v", err)
+	}
+	if len(runner.calls) != 3 {
+		t.Fatalf("expected 3 calls, got %d", len(runner.calls))
+	}
+}

+ 10 - 0
server-go/internal/adapters/openwrt.go

@@ -578,3 +578,13 @@ func radiosToAdapter(in []probe.Radio) []Radio {
 	}
 	return out
 }
+
+// GetArp devuelve la tabla ARP del equipo (MAC→IP, #377). Fuente barata
+// (cat /proc/net/arp) para resolver IPs cuando el DHCP no es local.
+func (c *OpenWrtClient) GetArp() map[string]string {
+	out, err := c.pool.Run(c.Host, probe.CmdProcArp, 0)
+	if err != nil {
+		return nil
+	}
+	return probe.ParseArp(out)
+}

+ 11 - 6
server-go/internal/adapters/portmonitor.go

@@ -39,15 +39,17 @@ type portState struct {
 }
 
 type PortMonitor struct {
-	mu     sync.Mutex
-	states map[portKey]*portState
-	now    func() time.Time
+	mu               sync.Mutex
+	states           map[portKey]*portState
+	now              func() time.Time
+	ghostEnabled     bool
 }
 
-func NewPortMonitor() *PortMonitor {
+func NewPortMonitor(ghostEnabled bool) *PortMonitor {
 	return &PortMonitor{
-		states: map[portKey]*portState{},
-		now:    time.Now,
+		states:       map[portKey]*portState{},
+		now:          time.Now,
+		ghostEnabled: ghostEnabled,
 	}
 }
 
@@ -134,6 +136,9 @@ func (pm *PortMonitor) checkFlapping(key portKey, st *portState, p EthPort, now
 }
 
 func (pm *PortMonitor) checkGhost(key portKey, st *portState, p EthPort, now time.Time, engine *alerts.Engine) {
+	if !pm.ghostEnabled {
+		return
+	}
 	total := p.RxBytes + p.TxBytes
 	if !p.Up {
 		st.zeroStreak = 0

+ 35 - 20
server-go/internal/adapters/portmonitor_test.go

@@ -1,6 +1,7 @@
 package adapters
 
 import (
+	"strings"
 	"testing"
 	"time"
 
@@ -8,7 +9,7 @@ import (
 )
 
 func TestPortMonitorFlapping(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	now := time.Date(2026, 8, 28, 12, 0, 0, 0, time.UTC)
 	pm.SetClock(func() time.Time { return now })
@@ -42,7 +43,7 @@ func TestPortMonitorFlapping(t *testing.T) {
 }
 
 func TestPortMonitorFlappingNoAlertBelowThreshold(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	now := time.Date(2026, 8, 28, 12, 0, 0, 0, time.UTC)
 	pm.SetClock(func() time.Time { return now })
@@ -65,7 +66,7 @@ func TestPortMonitorFlappingNoAlertBelowThreshold(t *testing.T) {
 }
 
 func TestPortMonitorFlappingWindowExpiry(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	now := time.Date(2026, 8, 28, 12, 0, 0, 0, time.UTC)
 	pm.SetClock(func() time.Time { return now })
@@ -93,7 +94,7 @@ func TestPortMonitorFlappingWindowExpiry(t *testing.T) {
 }
 
 func TestPortMonitorGhostPort(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	now := time.Date(2026, 8, 28, 12, 0, 0, 0, time.UTC)
 	pm.SetClock(func() time.Time { return now })
@@ -131,7 +132,7 @@ func TestPortMonitorGhostPort(t *testing.T) {
 }
 
 func TestPortMonitorGhostPortNoAlertWithoutHistory(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	now := time.Date(2026, 8, 28, 12, 0, 0, 0, time.UTC)
 	pm.SetClock(func() time.Time { return now })
@@ -152,7 +153,7 @@ func TestPortMonitorGhostPortNoAlertWithoutHistory(t *testing.T) {
 }
 
 func TestPortMonitorDegradedLink(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	now := time.Date(2026, 8, 28, 12, 0, 0, 0, time.UTC)
 	pm.SetClock(func() time.Time { return now })
@@ -192,7 +193,7 @@ func TestPortMonitorDegradedLink(t *testing.T) {
 }
 
 func TestPortMonitorDegradedLinkNoAlertWhenStable(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	now := time.Date(2026, 8, 28, 12, 0, 0, 0, time.UTC)
 	pm.SetClock(func() time.Time { return now })
@@ -266,7 +267,7 @@ func findAlerts(engine *alerts.Engine, title string) (int, alerts.AlertEvent) {
 // issue #366: un incidente persistente refresca UNA sola alerta (EmitOrUpdate)
 // en vez de colar una nueva por cada ventana de dedup.
 func TestPortMonitorGhostConsolidatesIntoOneAlert(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	port, setClock := buildGhostPort(t, pm, engine)
 
@@ -290,7 +291,7 @@ func TestPortMonitorGhostConsolidatesIntoOneAlert(t *testing.T) {
 
 // issue #365: un reset de contadores (reboot) NO es un puerto muerto.
 func TestPortMonitorGhostCounterResetNoAlert(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	port, setClock := buildGhostPort(t, pm, engine)
 
@@ -312,7 +313,7 @@ func TestPortMonitorGhostCounterResetNoAlert(t *testing.T) {
 
 // issue #366: al volver el tráfico se emite UNA alerta ok de recuperación.
 func TestPortMonitorGhostRecovery(t *testing.T) {
-	pm := NewPortMonitor()
+	pm := NewPortMonitor(true)
 	engine := alerts.New(nil, nil)
 	port, setClock := buildGhostPort(t, pm, engine)
 
@@ -339,21 +340,35 @@ func TestPortMonitorGhostRecovery(t *testing.T) {
 	}
 }
 
-// issue #366: flapping persistente también se consolida en una alerta.
-func TestPortMonitorFlappingConsolidatesIntoOneAlert(t *testing.T) {
-	pm := NewPortMonitor()
+// issue #419: cuando ghost port esta desactivado, no se emiten alertas de
+// puerto fantasma ni de recuperacion.
+func TestPortMonitorGhostDisabled(t *testing.T) {
+	pm := NewPortMonitor(false)
 	engine := alerts.New(nil, nil)
-	now := time.Date(2026, 8, 29, 12, 0, 0, 0, time.UTC)
+	now := time.Date(2026, 8, 28, 12, 0, 0, 0, time.UTC)
 	pm.SetClock(func() time.Time { return now })
-	port := EthPort{ID: "eth0", Label: "LAN1", Up: true, Speed: "1 Gbps"}
+
+	port := EthPort{ID: "eth0", Label: "LAN1", Up: true, RxBytes: 0, TxBytes: 0, Speed: "1 Gbps"}
 	pm.Observe("r1", []EthPort{port}, engine)
-	for i := 0; i < flapThreshold+4; i++ {
-		port.Up = !port.Up
-		now = now.Add(30 * time.Second)
+
+	for i := 0; i < ghostMinHistory; i++ {
+		port.RxBytes += 1000
+		port.TxBytes += 500
+		now = now.Add(45 * time.Second)
 		pm.SetClock(func() time.Time { return now })
 		pm.Observe("r1", []EthPort{port}, engine)
 	}
-	if n, _ := findAlerts(engine, "Port flapping: LAN1 on r1"); n != 1 {
-		t.Fatalf("flap alerts = %d, want 1 (consolidated)", n)
+
+	for i := 0; i < ghostConsecutive+2; i++ {
+		now = now.Add(45 * time.Second)
+		pm.SetClock(func() time.Time { return now })
+		pm.Observe("r1", []EthPort{port}, engine)
+	}
+
+	for _, ev := range engine.List() {
+		if strings.Contains(ev.Title, "Ghost port") {
+			t.Fatalf("ghost alert emitted while disabled: %s", ev.Title)
+		}
 	}
 }
+

+ 42 - 42
server-go/internal/adapters/types.go

@@ -357,10 +357,10 @@ type Overview struct {
 	// Cuando está presente, el frontend lo usa en vez de fetch independiente
 	// para garantizar consistencia con los anillos de topología.
 	Devices []Device `json:"devices,omitempty"`
-	// Dawn: disponibilidad de DAWN (roaming/band-steering) para decidir si la
-	// app muestra la entrada /roaming. Puntero: ausente en snapshots viejos y
-	// cuando ningún router tiene DAWN → nil = no mostrar la página.
-	Dawn *DawnOverview `json:"dawn,omitempty"`
+	// Usteer: disponibilidad de usteer (roaming/band-steering) para decidir si
+	// la app muestra la entrada /roaming. Puntero: ausente en snapshots viejos y
+	// cuando ningún router tiene usteer → nil = no mostrar la página.
+	Usteer *UsteerOverview `json:"usteer,omitempty"`
 	// Orchestration: el menú de orquestación (escritura en routers) está
 	// oculto por defecto y solo se muestra si el admin lo activa en Ajustes
 	// (#121). Default false (omitempty).
@@ -370,9 +370,9 @@ type Overview struct {
 	Ts int64 `json:"ts"` // floor(now/1000) — SEGUNDOS
 }
 
-// DawnOverview indica si la red tiene DAWN (roaming/band-steering) disponible.
-// Lo usa el frontend para mostrar/ocultar la entrada /roaming del menú.
-type DawnOverview struct {
+// UsteerOverview indica si la red tiene usteer (roaming/band-steering)
+// disponible. Lo usa el frontend para mostrar/ocultar la entrada /roaming.
+type UsteerOverview struct {
 	Available bool `json:"available"`
 }
 
@@ -495,45 +495,42 @@ type WGTotals struct {
 }
 
 // ---------------------------------------------------------------------------
-// DAWN (GET /api/dawn; SPEC §7.6) y AdGuard clients (§2.13)
+// usteer (GET /api/usteer; SPEC §7.6) y AdGuard clients (§2.13)
 // ---------------------------------------------------------------------------
 
-// DawnClient es un cliente visto por un AP en el hearing map de DAWN.
-// Signal en -dBm (más cercano a 0 = mejor). Un cliente puede aparecer bajo
-// varios BSSIDs: cada AP que lo ve reporta su propia medición de señal.
-type DawnClient struct {
+// UsteerClient es un cliente WiFi conectado visto por usteer. Signal en -dBm
+// (más cercano a 0 = mejor).
+type UsteerClient struct {
 	MAC    string `json:"mac"`
 	Signal int    `json:"signal"` // -dBm (ej. -65)
-	HT     bool   `json:"ht"`
-	VHT    bool   `json:"vht"`
-}
-
-// DawnAP es un punto de acceso visto por DAWN.
-type DawnAP struct {
-	SSID           string        `json:"ssid"`
-	BSSID          string        `json:"bssid"`
-	Hostname       string        `json:"hostname"`
-	Band           string        `json:"band"` // freq >= 5000 ? "5 GHz" : "2.4 GHz"
-	Channel        int           `json:"channel"`
-	UtilizationPct float64       `json:"utilizationPct"`
-	ClientCount    int           `json:"clientCount"` // num_sta reportado por DAWN
-	Clients        []DawnClient  `json:"clients"`     // clientes vistos por este AP (hearing map)
-	Local          bool          `json:"local"`
-	Iface          string        `json:"iface"`
-}
-
-// DawnMesh marca por router si tiene DAWN y cuántos APs ve.
-type DawnMesh struct {
+}
+
+// UsteerAP es un punto de acceso visto por usteer (local o remoto).
+type UsteerAP struct {
+	SSID           string         `json:"ssid"`
+	BSSID          string         `json:"bssid"`
+	Hostname       string         `json:"hostname"`
+	Band           string         `json:"band"` // freq >= 5000 ? "5 GHz" : "2.4 GHz"
+	Freq           int            `json:"freq"` // MHz
+	UtilizationPct int            `json:"utilizationPct"` // load reportado por usteer
+	ClientCount    int            `json:"clientCount"`    // n_assoc
+	Clients        []UsteerClient `json:"clients"`
+	Local          bool           `json:"local"`
+	Iface          string         `json:"iface"`
+}
+
+// UsteerMesh marca por router si tiene usteer y cuántos APs ve.
+type UsteerMesh struct {
 	RouterID string `json:"routerId"`
 	Name     string `json:"name"`
-	Dawn     bool   `json:"dawn"`
+	Usteer   bool   `json:"usteer"`
 	ApsSeen  int    `json:"apsSeen"`
 }
 
-// Dawn es la respuesta de /api/dawn (503 si ningún router tiene DAWN).
-type Dawn struct {
-	APs  []DawnAP   `json:"aps"`
-	Mesh []DawnMesh `json:"mesh"`
+// Usteer es la respuesta de /api/usteer (503 si ningún router tiene usteer).
+type Usteer struct {
+	APs  []UsteerAP   `json:"aps"`
+	Mesh []UsteerMesh `json:"mesh"`
 }
 
 // ---------------------------------------------------------------------------
@@ -597,7 +594,7 @@ type Dot11rSSID struct {
 }
 
 // Dot11rOverview es la respuesta de GET /api/dot11r. Available=false si ningún
-// router tiene 802.11r (el handler devuelve 503 en ese caso, igual que /dawn).
+// router tiene 802.11r (el handler devuelve 503 en ese caso, igual que /usteer).
 type Dot11rOverview struct {
 	Available bool           `json:"available"`
 	SSIDs     []Dot11rSSID   `json:"ssids"`
@@ -695,12 +692,12 @@ type RouterConfig struct {
 
 // Snapshotter es el contrato del adapter de datos (paridad con la interfaz JS
 // de SPEC §7: mode/tick/setRouters/getOverview/getRouters/getRouterDetail/
-// getDevices/getAlerts/getMetricsRows/getDawn/getDot11r/getSurvey/getAdguardClients/close;
+// getDevices/getAlerts/getMetricsRows/getUsteer/getDot11r/getSurvey/getAdguardClients/close;
 // getAdguardRow() está muerto en Node y NO se porta).
 //
 // Convenciones de retorno (consumidas por internal/httpapi):
 //   - GetRouterDetail: (nil, nil) → 404 {"error":"not_found"}.
-//   - GetDawn: (nil, nil) → 503 {"error":"unavailable"}.
+//   - GetUsteer: (nil, nil) → 503 {"error":"unavailable"}.
 //   - GetDot11r: (nil, nil) → 503 {"error":"unavailable"}.
 //   - GetSurvey: (nil, nil) → 503 {"error":"unavailable"}.
 //   - GetAdguardClients: (nil, nil) → 404 {"error":"not_configured"};
@@ -733,8 +730,11 @@ type Snapshotter interface {
 	// GetMetricsRows devuelve las filas para la tabla metrics del tick
 	// actual (el poller solo persiste si Mode() != "demo").
 	GetMetricsRows(ctx context.Context) []MetricsRow
-	// GetDawn devuelve la malla DAWN o (nil, nil) si no hay DAWN.
-	GetDawn(ctx context.Context) (*Dawn, error)
+	// GetUsteer devuelve la malla usteer o (nil, nil) si no hay usteer.
+	GetUsteer(ctx context.Context) (*Usteer, error)
+	// KickUsteerClient desconecta un cliente de su AP usteer actual.
+	// Devuelve error si no se encuentra o falla el comando hostapd.
+	KickUsteerClient(ctx context.Context, mac string) error
 	// GetDot11r devuelve el estado 802.11r (FT) por router y SSID, o
 	// (nil, nil) si ningún router lo soporta → el handler responde 503.
 	GetDot11r(ctx context.Context) (*Dot11rOverview, error)

+ 99 - 0
server-go/internal/adapters/usteer_test.go

@@ -0,0 +1,99 @@
+package adapters
+
+import (
+	"encoding/json"
+	"testing"
+)
+
+// TestBuildUsteerAP parsea una salida sintética de `ubus call usteer
+// local_info` (shapes verificados en rt3) a UsteerAP, comprobando band/freq/
+// load/n_assoc/local/bssid uppercase.
+func TestBuildUsteerAP(t *testing.T) {
+	const localInfo = `{
+  "hostapd.phy0-ap0": {
+    "bssid": "9c:9d:7e:1b:ea:b3",
+    "ssid": "temiscira",
+    "freq": 5260,
+    "n_assoc": 0,
+    "noise": -108,
+    "load": 3,
+    "max_assoc": 0,
+    "roam_events": { "source": 0, "target": 0 },
+    "rrm_nr": ["9c:9d:7e:1b:ea:b3"]
+  },
+  "hostapd.phy1-ap0": {
+    "bssid": "9c:9d:7e:1b:ea:b2",
+    "ssid": "temiscira",
+    "freq": 2442,
+    "n_assoc": 2,
+    "load": 20
+  }
+}`
+	var local map[string]usteerAPRaw
+	if err := json.Unmarshal([]byte(localInfo), &local); err != nil {
+		t.Fatalf("unmarshal local_info: %v", err)
+	}
+	if len(local) != 2 {
+		t.Fatalf("esperaba 2 APs, got %d", len(local))
+	}
+
+	ap := buildUsteerAP("hostapd.phy0-ap0", local["hostapd.phy0-ap0"], "rt3", true)
+	if ap.SSID != "temiscira" || ap.BSSID != "9C:9D:7E:1B:EA:B3" {
+		t.Errorf("ap = %+v", ap)
+	}
+	if ap.Band != "5 GHz" || ap.Freq != 5260 {
+		t.Errorf("band/freq = %q/%d, want 5 GHz/5260", ap.Band, ap.Freq)
+	}
+	if ap.UtilizationPct != 3 || ap.ClientCount != 0 {
+		t.Errorf("load/n_assoc = %d/%d, want 3/0", ap.UtilizationPct, ap.ClientCount)
+	}
+	if !ap.Local || ap.Hostname != "rt3" {
+		t.Errorf("local/hostname = %v/%q", ap.Local, ap.Hostname)
+	}
+	if ap.Clients == nil {
+		t.Error("Clients debería ser slice vacío, no nil")
+	}
+
+	ap2 := buildUsteerAP("hostapd.phy1-ap0", local["hostapd.phy1-ap0"], "rt3", true)
+	if ap2.Band != "2.4 GHz" || ap2.Freq != 2442 || ap2.ClientCount != 2 {
+		t.Errorf("ap2 = %+v", ap2)
+	}
+}
+
+// TestBuildUsteerAPWithClients verifica que connected_clients se asocia al AP
+// por iface y se ordena por MAC.
+func TestBuildUsteerAPWithClients(t *testing.T) {
+	raw := usteerAPRaw{
+		BSSID:  "9c:9d:7e:1b:ea:b2",
+		SSID:   "temiscira",
+		Freq:   2462,
+		NAssoc: 2,
+		Load:   39,
+	}
+	clients := map[string]usteerClientRaw{
+		"40:44:f7:38:32:28": {Signal: -83},
+		"d8:d6:68:32:7c:46": {Signal: -53},
+		"00:00:00:00:00:00": {Signal: 0}, // se ignora
+	}
+	ap := buildUsteerAPWithClients("hostapd.phy1-ap0", raw, clients, "rt3", true)
+	if len(ap.Clients) != 2 {
+		t.Fatalf("esperaba 2 clientes, got %d", len(ap.Clients))
+	}
+	if ap.Clients[0].MAC != "40:44:F7:38:32:28" || ap.Clients[0].Signal != -83 {
+		t.Errorf("client[0] = %+v", ap.Clients[0])
+	}
+	if ap.Clients[1].MAC != "D8:D6:68:32:7C:46" || ap.Clients[1].Signal != -53 {
+		t.Errorf("client[1] = %+v", ap.Clients[1])
+	}
+}
+
+// TestBuildUsteerAPVacio: entrada sin ssid/bssid se descarta en GetUsteer.
+func TestBuildUsteerAPVacio(t *testing.T) {
+	ap := buildUsteerAP("hostapd.phy0-ap0", usteerAPRaw{}, "rt3", true)
+	if ap.SSID != "" || ap.BSSID != "" {
+		t.Errorf("AP vacío debería tener ssid/bssid vacío: %+v", ap)
+	}
+	if ap.Band != "2.4 GHz" {
+		t.Errorf("freq 0 debería caer en 2.4 GHz: %q", ap.Band)
+	}
+}

+ 16 - 0
server-go/internal/config/config.go

@@ -66,6 +66,7 @@ type Config struct {
 	BeaconListen    string // NETPULSE_BEACON_LISTEN: socket UDP de beacons embebidos (#291); "" = off, p. ej. ":5140"
 	AgentAutoenroll bool   // AGENT_AUTOENROLL=1: el responder UDP entrega token de alta y /pair lo acepta (#367)
 	Onbox           bool   // NETPULSE_ONBOX=1: modo on-box (Fase 9: config UCI, bootstrap AUTH_PASS)
+	GhostPortEnabled bool  // GHOST_PORT_ENABLED=1: activa alertas de ghost port (#419); default false
 }
 
 // LoadDotEnv parsea un .env: KEY=VALUE por línea, '#' comentarios (línea
@@ -373,6 +374,20 @@ func Load(env map[string]string, serverRoot string) (*Config, error) {
 		}
 	}
 
+	// GHOST_PORT_ENABLED: '0'|'1', opcional - default false. Activa las alertas
+	// de ghost port; mientras este desactivado, PortMonitor no evalua ni emite
+	// alertas de puerto fantasma (#419).
+	ghostPortEnabled := false
+	if v, ok := env["GHOST_PORT_ENABLED"]; ok && v != "" {
+		switch v {
+		case "0":
+		case "1":
+			ghostPortEnabled = true
+		default:
+			errs.issues = append(errs.issues, issue{"GHOST_PORT_ENABLED", "Invalid enum value. Expected '0' | '1'"})
+		}
+	}
+
 	if len(errs.issues) > 0 {
 		return nil, &errs
 	}
@@ -440,6 +455,7 @@ func Load(env map[string]string, serverRoot string) (*Config, error) {
 		BeaconListen:    beaconListen,
 		AgentAutoenroll: agentAutoenroll,
 		Onbox:           onbox,
+		GhostPortEnabled: ghostPortEnabled,
 	}, nil
 }
 

+ 12 - 1
server-go/internal/httpapi/config.go

@@ -370,11 +370,22 @@ func (s *server) handlePutAdguardConfig(w http.ResponseWriter, r *http.Request)
 		writeError(w, http.StatusBadRequest, "invalid_input", "Required")
 		return
 	}
-	host, port, msg := validateAdGuardHost(*in.Host)
+	host, portFromHost, msg := validateAdGuardHost(*in.Host)
 	if msg != "" {
 		writeError(w, http.StatusBadRequest, "invalid_input", msg)
 		return
 	}
+	port := 0
+	if mode == "standard" {
+		if in.Port < 1 || in.Port > 65535 {
+			writeError(w, http.StatusBadRequest, "invalid_input", "port must be between 1 and 65535")
+			return
+		}
+		port = in.Port
+	}
+	if mode == "standard" && port == 0 {
+		port = portFromHost
+	}
 	if mode == "standard" && port == 0 {
 		port = 3000
 	}

+ 47 - 0
server-go/internal/httpapi/config_test.go

@@ -320,6 +320,53 @@ func TestConfigRoutersFirmwareTarget(t *testing.T) {
 	}
 }
 
+// TestAdGuardConfigPort cubre PUT /api/config/adguard (#420):
+//   - guardar un puerto distinto de 3000 en modo standard
+//   - GET devuelve el puerto guardado, no 3000
+//   - el puerto explícito tiene prioridad sobre el que pueda venir en host:port
+func TestAdGuardConfigPort(t *testing.T) {
+	srv := makeTestServer(t)
+	_, cookie, _ := loginCookie(t, srv.URL, "admin", "test123456")
+
+	// PUT modo standard con puerto 80
+	res := doReq(t, "PUT", srv.URL+"/api/config/adguard", cookie,
+		`{"mode":"standard","host":"adguard.example.com","port":80,"user":"root","password":"secret"}`)
+	if res.StatusCode != 204 {
+		body := readJSON(t, res)
+		t.Fatalf("PUT adguard: %d %v", res.StatusCode, body)
+	}
+
+	// GET debe devolver puerto 80
+	res = doReq(t, "GET", srv.URL+"/api/config/adguard", cookie, "")
+	if res.StatusCode != 200 {
+		t.Fatalf("GET adguard: %d", res.StatusCode)
+	}
+	body := readJSON(t, res)
+	if body["port"].(float64) != 80 {
+		t.Fatalf("port esperado 80, got %v", body["port"])
+	}
+
+	// Puerto explícito tiene prioridad sobre host:port
+	res = doReq(t, "PUT", srv.URL+"/api/config/adguard", cookie,
+		`{"mode":"standard","host":"adguard.example.com:8080","port":9090,"user":"root","password":"secret"}`)
+	if res.StatusCode != 204 {
+		body := readJSON(t, res)
+		t.Fatalf("PUT adguard con host:port: %d %v", res.StatusCode, body)
+	}
+	res = doReq(t, "GET", srv.URL+"/api/config/adguard", cookie, "")
+	body = readJSON(t, res)
+	if body["port"].(float64) != 9090 {
+		t.Fatalf("port esperado 9090, got %v", body["port"])
+	}
+
+	// Puerto fuera de rango → 400
+	res = doReq(t, "PUT", srv.URL+"/api/config/adguard", cookie,
+		`{"mode":"standard","host":"adguard.example.com","port":70000,"user":"root","password":"secret"}`)
+	if res.StatusCode != 400 {
+		t.Fatalf("port fuera de rango: esperado 400, got %d", res.StatusCode)
+	}
+}
+
 func TestConfigRoutersSNMP(t *testing.T) {
 	srv := makeTestServer(t)
 	_, cookie, _ := loginCookie(t, srv.URL, "admin", "test123456")

+ 28 - 5
server-go/internal/httpapi/data.go

@@ -371,18 +371,41 @@ func (s *server) handleTopology(w http.ResponseWriter, r *http.Request) {
 	writeJSON(w, http.StatusOK, map[string]any{"routers": routers, "devices": devices})
 }
 
-// handleDawn: 503 {error:'unavailable'} si ningún router tiene DAWN.
-func (s *server) handleDawn(w http.ResponseWriter, r *http.Request) {
-	dawn, err := s.adapter.GetDawn(r.Context())
+// handleUsteer: 503 {error:'unavailable'} si ningún router tiene usteer.
+func (s *server) handleUsteer(w http.ResponseWriter, r *http.Request) {
+	usteer, err := s.adapter.GetUsteer(r.Context())
 	if err != nil {
 		writeError(w, http.StatusInternalServerError, "internal_error")
 		return
 	}
-	if dawn == nil {
+	if usteer == nil {
 		writeError(w, http.StatusServiceUnavailable, "unavailable")
 		return
 	}
-	writeJSON(w, http.StatusOK, dawn)
+	writeJSON(w, http.StatusOK, usteer)
+}
+
+// handleUsteerKick: POST /api/usteer/{mac}/kick - expulsa un cliente de su AP
+// usteer actual para forzar la reconexión a otro AP.
+func (s *server) handleUsteerKick(w http.ResponseWriter, r *http.Request) {
+	mac := r.PathValue("mac")
+	if mac == "" {
+		writeError(w, http.StatusBadRequest, "invalid_input", "mac is required")
+		return
+	}
+	if err := s.adapter.KickUsteerClient(r.Context(), mac); err != nil {
+		if err.Error() == "invalid MAC" {
+			writeError(w, http.StatusBadRequest, "invalid_input", err.Error())
+			return
+		}
+		if strings.Contains(err.Error(), "client not found") {
+			writeError(w, http.StatusNotFound, "not_found", err.Error())
+			return
+		}
+		writeError(w, http.StatusInternalServerError, "internal_error", err.Error())
+		return
+	}
+	writeJSON(w, http.StatusOK, map[string]any{"ok": true})
 }
 
 // handleDot11r: 503 {error:'unavailable'} si ningún router tiene 802.11r.

+ 1 - 1
server-go/internal/httpapi/httpapi_test.go

@@ -733,7 +733,7 @@ func TestRoutersYDetalle(t *testing.T) {
 		t.Fatalf("detalle desconocido: %d %v", res.StatusCode, body)
 	}
 	// DAWN: el stub devuelve null → 503
-	res = get(t, srv.URL, "/api/dawn", cookie)
+	res = get(t, srv.URL, "/api/usteer", cookie)
 	body = readJSON(t, res)
 	if res.StatusCode != 503 || body["error"] != "unavailable" {
 		t.Fatalf("dawn: %d %v", res.StatusCode, body)

+ 9 - 9
server-go/internal/httpapi/orchestr.go

@@ -385,8 +385,8 @@ func (s *server) computeModuleDiff(resource, routerID string, desired json.RawMe
 		}
 		ops := orchestr.WireGuardOps(d, sc)
 		return ops, wireGuardMethod(sc, d.Interface), nil
-	case "dawn":
-		var d orchestr.DawnDesired
+	case "usteer":
+		var d orchestr.UsteerDesired
 		if err := json.Unmarshal(desired, &d); err != nil {
 			return nil, "", fmt.Errorf("%w: %v", errInvalidDesired, err)
 		}
@@ -394,14 +394,14 @@ func (s *server) computeModuleDiff(resource, routerID string, desired json.RawMe
 		if host == "" {
 			return nil, "", errRouterNotFound
 		}
-		// DAWN es un servicio mesh por AP: puede desplegarse en cualquier
-		// router que sea AP de distribución, no solo en el gateway.
-		sc, err := orchestr.DetectDawn(s.pool, host)
+		// usteer es un servicio de steering por AP: puede desplegarse en
+		// cualquier router que sea AP de distribución, no solo en el gateway.
+		sc, err := orchestr.DetectUsteer(s.pool, host)
 		if err != nil {
 			return nil, "", fmt.Errorf("%w: %v", errProbeFailed, err)
 		}
-		ops := orchestr.DawnOps(d, sc)
-		return ops, orchestr.DawnMethod(sc), nil
+		ops := orchestr.UsteerOps(d, sc)
+		return ops, orchestr.UsteerMethod(sc), nil
 	default:
 		return nil, "", fmt.Errorf("%w: %s", errUnknownModule, resource)
 	}
@@ -522,8 +522,8 @@ func invertDesired(resource string, desired json.RawMessage) (json.RawMessage, e
 		}
 		d.Enabled = !d.Enabled
 		return json.Marshal(d)
-	case "dawn":
-		var d orchestr.DawnDesired
+	case "usteer":
+		var d orchestr.UsteerDesired
 		if err := json.Unmarshal(desired, &d); err != nil {
 			return nil, fmt.Errorf("desired inválido: %w", err)
 		}

+ 3 - 2
server-go/internal/httpapi/server.go

@@ -49,7 +49,7 @@ import (
 // Version es la versión del backend (app.js:18). Es una var (no const) para
 // que goreleaser la inyecte con -X httpapi.Version={{.Version}} y el health
 // reporte la versión del tag; los builds locales caen al fallback.
-var Version = "2.22.2"
+var Version = "2.23.0"
 
 // Deps son las dependencias del servidor API (como createApp de app.js).
 type Deps struct {
@@ -268,7 +268,8 @@ func NewHandler(d Deps) http.Handler {
 	mux.HandleFunc("GET /api/path/destinations", s.handlePathDestinations)
 	mux.HandleFunc("GET /api/metrics", s.handleMetrics)
 	mux.HandleFunc("GET /api/topology", s.handleTopology)
-	mux.HandleFunc("GET /api/dawn", s.handleDawn)
+	mux.HandleFunc("GET /api/usteer", s.handleUsteer)
+	mux.HandleFunc("POST /api/usteer/{mac}/kick", s.handleUsteerKick)
 	mux.HandleFunc("GET /api/dot11r", s.handleDot11r)
 	mux.HandleFunc("GET /api/survey", s.handleSurvey)
 	mux.HandleFunc("GET /api/roam-events", s.handleRoamEvents)

+ 2 - 1
server-go/internal/orchestr/modules.go

@@ -8,7 +8,8 @@
 //   - ddns      → ddns.go (Fase 17.3)
 //   - sqm       → sqm.go (Fase 17.4)
 //   - wireguard → wireguard.go (Fase 10.3)
-//   - dawn      → dawn.go (Fase 17.9)
+//   - usteer    → usteer.go (sustituye a dawn; Fase 17.10)
+//   - dawn      → dawn.go (legacy, sin dispatch; conservado por rollback/compat)
 //
 // Fase 17.1: AdGuardOps usa el AdGuardScenario (probe SSH del servidor) para
 // elegir entre 4 métodos deterministas: apk | opkg | none (binario ya

+ 367 - 0
server-go/internal/orchestr/usteer.go

@@ -0,0 +1,367 @@
+// usteer.go - modulo de orquestacion "usteer".
+//
+// Instala/configura usteer (daemon oficial de OpenWrt para roaming/steering)
+// y alinea los parametros de roaming 802.11k/v/r en los APs. El modulo es
+// declarativo: compara el estado detectado contra un baseline deseado y
+// genera las Ops allowlistedas necesarias.
+//
+// Baseline por defecto (verificado en red Mandor):
+//   - aggressiveness=3 (BSS-transition-request con disassociation imminent y timer)
+//   - band_steering_threshold=5
+//   - load_balancing_threshold=0
+//   - debug_level=2, syslog=1, network=lan, enabled=1
+//   - 802.11k=1, 802.11v=1, 802.11r=1, bss_transition=1, ft_over_ds=0,
+//     ft_psk_generate_local=1, mobility_domain comun
+//   - random_bssid=0 en todas las radios
+package orchestr
+
+import (
+	"fmt"
+	"regexp"
+	"strconv"
+	"strings"
+	"time"
+
+	"github.com/gnacho/netpulse/agent/executor"
+)
+
+// UsteerDesired es el estado deseado del modulo usteer.
+type UsteerDesired struct {
+	Enabled                bool   `json:"enabled"`
+	SSID                   string `json:"ssid,omitempty"`               // SSID a gestionar; vacio = todas las de modo AP
+	MobilityDomain         string `json:"mobilityDomain,omitempty"`       // p. ej. "2025"
+	Aggressiveness         string `json:"aggressiveness,omitempty"`         // default "3"
+	BandSteeringThreshold  string `json:"bandSteeringThreshold,omitempty"`  // default "5"
+	LoadBalancingThreshold string `json:"loadBalancingThreshold,omitempty"` // default "0"
+	DebugLevel             string `json:"debugLevel,omitempty"`             // default "2"
+	IEEE80211K             bool   `json:"ieee80211k,omitempty"`
+	IEEE80211R             bool   `json:"ieee80211r,omitempty"`
+	IEEE80211V             bool   `json:"ieee80211v,omitempty"`
+	BSSTransition          bool   `json:"bssTransition,omitempty"`
+	FTOverDS               bool   `json:"ftOverDs,omitempty"`
+	FTPskGenerateLocal     bool   `json:"ftPskGenerateLocal,omitempty"`
+}
+
+// UsteerSSID describe una seccion wifi-iface.
+type UsteerSSID struct {
+	Section            string
+	SSID               string
+	Mode               string
+	Device             string
+	IEEE80211K         string
+	IEEE80211R         string
+	IEEE80211V         string
+	BSSTransition      string
+	FTOverDS           string
+	FTPskGenerateLocal string
+	MobilityDomain     string
+}
+
+// UsteerRadio describe una seccion wifi-device.
+type UsteerRadio struct {
+	Section     string
+	RandomBSSID string
+}
+
+// UsteerScenario describe el estado detectado de usteer en un router.
+type UsteerScenario struct {
+	Manager        string            // apk | opkg | ""
+	UsteerInstalled bool
+	UsteerRunning   bool
+	WpadVariant    string            // basic | mbedtls | wolfssl | openssl | other | ""
+	HostapdDirOK   bool
+	Config         map[string]string // usteer.@usteer[-1] options
+	SSIDs          []UsteerSSID
+	Radios         []UsteerRadio
+}
+
+const probeUsteerCmd = `echo '===PKG_MGR==='
+[ -x /usr/bin/apk ] && echo apk || echo opkg
+echo '===USTEER_INST==='
+[ -x /etc/init.d/usteer ] && echo yes || echo no
+echo '===USTEER_RUN==='
+/etc/init.d/usteer running >/dev/null 2>&1 && echo yes || echo no
+echo '===WPAD==='
+opkg list-installed 2>/dev/null | grep -E '^wpad-' || true
+apk list --installed 2>/dev/null | grep -E '^wpad-' || true
+echo '===HOSTAPD_DIR==='
+[ -d /var/run/hostapd ] && echo yes || echo no
+echo '===USTEER_UCI==='
+uci show usteer 2>/dev/null
+echo '===WIRELESS_UCI==='
+uci show wireless 2>/dev/null
+echo '===END==='`
+
+// DetectUsteer ejecuta el probe combinado via SSH y devuelve el escenario.
+func DetectUsteer(run CommandRunner, host string) (UsteerScenario, error) {
+	out, err := run.Run(host, probeUsteerCmd, 10*time.Second)
+	if err != nil {
+		return UsteerScenario{}, err
+	}
+	return parseUsteer(out), nil
+}
+
+func parseUsteer(out string) UsteerScenario {
+	sc := UsteerScenario{Config: map[string]string{}}
+	sections := splitSections(out)
+
+	sc.Manager = strings.TrimSpace(firstNonEmpty(sections["PKG_MGR"]))
+	if sc.Manager == "" {
+		sc.Manager = "opkg"
+	}
+	sc.UsteerInstalled = strings.TrimSpace(firstNonEmpty(sections["USTEER_INST"])) == "yes"
+	sc.UsteerRunning = strings.TrimSpace(firstNonEmpty(sections["USTEER_RUN"])) == "yes"
+	sc.HostapdDirOK = strings.TrimSpace(firstNonEmpty(sections["HOSTAPD_DIR"])) == "yes"
+	sc.WpadVariant = parseWpadVariant(sections["WPAD"])
+
+	for _, line := range sections["USTEER_UCI"] {
+		line = strings.TrimSpace(line)
+		// usteer.@usteer[N].option='value'
+		m := reUsteerOption.FindStringSubmatch(line)
+		if m == nil {
+			continue
+		}
+		sc.Config[m[1]] = strings.Trim(m[2], "'")
+	}
+
+	sc.SSIDs, sc.Radios = parseWirelessUsteer(sections["WIRELESS_UCI"])
+	return sc
+}
+
+// reUsteerOption captura `usteer.@usteer[N].option='value'`. `uci show usteer`
+// imprime la sección anónima con su índice real (`@usteer[0]`), no con la
+// referencia `[-1]` que solo vale para `uci set`. Se aceptan ambas formas.
+var reUsteerOption = regexp.MustCompile(`^usteer\.@usteer\[-?\d+\]\.([a-z0-9_]+)=(.+)$`)
+
+func parseWirelessUsteer(lines []string) (ssids []UsteerSSID, radios []UsteerRadio) {
+	uci := strings.Join(lines, "\n")
+	for _, line := range lines {
+		line = strings.TrimSpace(line)
+		if !strings.HasPrefix(line, "wireless.") {
+			continue
+		}
+		rest := strings.TrimPrefix(line, "wireless.")
+		parts := strings.SplitN(rest, "=", 2)
+		if len(parts) != 2 {
+			continue
+		}
+		secFull := parts[0]
+		typ := strings.Trim(parts[1], "'")
+		if typ == "wifi-iface" {
+			ssids = append(ssids, UsteerSSID{
+				Section:            secFull,
+				SSID:               wirelessOpt(uci, secFull, "ssid"),
+				Mode:               wirelessOpt(uci, secFull, "mode"),
+				Device:             wirelessOpt(uci, secFull, "device"),
+				IEEE80211K:         wirelessOpt(uci, secFull, "ieee80211k"),
+				IEEE80211R:         wirelessOpt(uci, secFull, "ieee80211r"),
+				IEEE80211V:         wirelessOpt(uci, secFull, "ieee80211v"),
+				BSSTransition:      wirelessOpt(uci, secFull, "bss_transition"),
+				FTOverDS:           wirelessOpt(uci, secFull, "ft_over_ds"),
+				FTPskGenerateLocal: wirelessOpt(uci, secFull, "ft_psk_generate_local"),
+				MobilityDomain:     wirelessOpt(uci, secFull, "mobility_domain"),
+			})
+		} else if typ == "wifi-device" {
+			radios = append(radios, UsteerRadio{
+				Section:     secFull,
+				RandomBSSID: wirelessOpt(uci, secFull, "random_bssid"),
+			})
+		}
+	}
+	return
+}
+
+// UsteerOps genera las Ops para reconciliar el estado deseado de usteer.
+func UsteerOps(desired UsteerDesired, sc UsteerScenario) []executor.Op {
+	if !desired.Enabled {
+		return usteerDisableOps(sc)
+	}
+	d := normalizeUsteerDesired(desired)
+	var ops []executor.Op
+
+	// 1. Instalar usteer si falta.
+	if !sc.UsteerInstalled {
+		if sc.Manager == "apk" {
+			ops = append(ops, executor.Op{Kind: "apk_install", Args: map[string]string{"package": "usteer"}, Desc: "Install usteer (apk)"})
+			ops = append(ops, executor.Op{Kind: "apk_install", Args: map[string]string{"package": "luci-app-usteer"}, Desc: "Install LuCI usteer (apk)"})
+		} else {
+			ops = append(ops, executor.Op{Kind: "install", Args: map[string]string{"package": "usteer"}, Desc: "Install usteer (opkg)"})
+			ops = append(ops, executor.Op{Kind: "install", Args: map[string]string{"package": "luci-app-usteer"}, Desc: "Install LuCI usteer (opkg)"})
+		}
+	}
+
+	// 2. Asegurar wpad completo si solo hay wpad-basic/mini.
+	if sc.WpadVariant == "basic" || sc.WpadVariant == "mini" || sc.WpadVariant == "" {
+		pkg := "wpad-wolfssl"
+		if sc.Manager == "apk" {
+			pkg = "wpad-mbedtls"
+		}
+		ops = append(ops, executor.Op{Kind: installKind(sc.Manager), Args: map[string]string{"package": pkg}, Desc: "Install full wpad for usteer"})
+	}
+
+	// 3. Asegurar la seccion usteer y options.
+	if len(sc.Config) == 0 {
+		ops = append(ops, executor.Op{Kind: "uci_set_named", Args: map[string]string{"config": "usteer", "section": "usteer", "type": "usteer"}, Desc: "Ensure usteer section"})
+	}
+	setUsteerOptionIfDiffers(&ops, sc, "enabled", "1")
+	setUsteerOptionIfDiffers(&ops, sc, "network", "lan")
+	setUsteerOptionIfDiffers(&ops, sc, "syslog", "1")
+	setUsteerOptionIfDiffers(&ops, sc, "debug_level", d.DebugLevel)
+	setUsteerOptionIfDiffers(&ops, sc, "aggressiveness", d.Aggressiveness)
+	setUsteerOptionIfDiffers(&ops, sc, "band_steering_threshold", d.BandSteeringThreshold)
+	setUsteerOptionIfDiffers(&ops, sc, "load_balancing_threshold", d.LoadBalancingThreshold)
+	setUsteerOptionIfDiffers(&ops, sc, "min_connect_snr", "0")
+	setUsteerOptionIfDiffers(&ops, sc, "min_snr", "0")
+	setUsteerOptionIfDiffers(&ops, sc, "roam_trigger_snr", "0")
+	setUsteerOptionIfDiffers(&ops, sc, "roam_scan_snr", "0")
+
+	// 4. Wireless: aplicar baseline a cada SSID de modo AP.
+	for _, s := range sc.SSIDs {
+		if s.Mode != "ap" {
+			continue
+		}
+		if d.SSID != "" && s.SSID != d.SSID {
+			continue
+		}
+		sec := s.Section
+		setWirelessBoolIfDiffers(&ops, s.IEEE80211K, sec, "ieee80211k", d.IEEE80211K, true)
+		setWirelessBoolIfDiffers(&ops, s.IEEE80211R, sec, "ieee80211r", d.IEEE80211R, true)
+		setWirelessBoolIfDiffers(&ops, s.IEEE80211V, sec, "ieee80211v", d.IEEE80211V, true)
+		setWirelessBoolIfDiffers(&ops, s.BSSTransition, sec, "bss_transition", d.BSSTransition, true)
+		setWirelessBoolIfDiffers(&ops, s.FTOverDS, sec, "ft_over_ds", d.FTOverDS, false)
+		setWirelessBoolIfDiffers(&ops, s.FTPskGenerateLocal, sec, "ft_psk_generate_local", d.FTPskGenerateLocal, true)
+		if d.MobilityDomain != "" && s.MobilityDomain != d.MobilityDomain {
+			ops = append(ops, executor.Op{Kind: "uci_set", Args: map[string]string{"config": "wireless", "section": sec, "option": "mobility_domain", "value": d.MobilityDomain}, Desc: "Set mobility domain on " + sec})
+		}
+	}
+
+	// 5. Radios: random_bssid=0.
+	for _, r := range sc.Radios {
+		if r.RandomBSSID != "0" {
+			ops = append(ops, executor.Op{Kind: "uci_set", Args: map[string]string{"config": "wireless", "section": r.Section, "option": "random_bssid", "value": "0"}, Desc: "Disable random BSSID on " + r.Section})
+		}
+	}
+
+	if len(ops) == 0 {
+		return nil
+	}
+
+	ops = append(ops, executor.Op{Kind: "uci_commit", Args: map[string]string{"config": "usteer"}, Desc: "Commit usteer config"})
+	ops = append(ops, executor.Op{Kind: "uci_commit", Args: map[string]string{"config": "wireless"}, Desc: "Commit wireless config"})
+	ops = append(ops, executor.Op{Kind: "service", Args: map[string]string{"name": "usteer", "action": "enable"}, Desc: "Enable usteer on boot"})
+	ops = append(ops, executor.Op{Kind: "service", Args: map[string]string{"name": "usteer", "action": "start"}, Desc: "Start usteer"})
+	return ops
+}
+
+func setUsteerOptionIfDiffers(ops *[]executor.Op, sc UsteerScenario, option, want string) {
+	if want == "" {
+		return
+	}
+	if sc.Config[option] == want {
+		return
+	}
+	*ops = append(*ops, executor.Op{Kind: "uci_set", Args: map[string]string{"config": "usteer", "section": "@usteer[-1]", "option": option, "value": want}, Desc: "Set usteer " + option})
+}
+
+func usteerDisableOps(sc UsteerScenario) []executor.Op {
+	if !sc.UsteerInstalled && len(sc.Config) == 0 {
+		return nil
+	}
+	return []executor.Op{
+		{Kind: "uci_set", Args: map[string]string{"config": "usteer", "section": "@usteer[-1]", "option": "enabled", "value": "0"}, Desc: "Disable usteer"},
+		{Kind: "uci_commit", Args: map[string]string{"config": "usteer"}, Desc: "Commit usteer config"},
+		{Kind: "service", Args: map[string]string{"name": "usteer", "action": "stop"}, Desc: "Stop usteer"},
+		{Kind: "service", Args: map[string]string{"name": "usteer", "action": "disable"}, Desc: "Disable usteer on boot"},
+	}
+}
+
+func normalizeUsteerDesired(d UsteerDesired) UsteerDesired {
+	if d.Aggressiveness == "" {
+		d.Aggressiveness = "3"
+	}
+	if d.BandSteeringThreshold == "" {
+		d.BandSteeringThreshold = "5"
+	}
+	if d.LoadBalancingThreshold == "" {
+		d.LoadBalancingThreshold = "0"
+	}
+	if d.DebugLevel == "" {
+		d.DebugLevel = "2"
+	}
+	return d
+}
+
+// UsteerHealthcheck verifica que usteer responde y ve vecinos tras el apply.
+func UsteerHealthcheck(run CommandRunner, host string) error {
+	out, err := run.Run(host, "ubus call usteer remote_hosts", 5*time.Second)
+	if err != nil {
+		return fmt.Errorf("usteer remote_hosts failed: %w", err)
+	}
+	out = strings.TrimSpace(out)
+	if out == "" || out == "{}" {
+		return fmt.Errorf("usteer remote_hosts returned empty mesh")
+	}
+	return nil
+}
+
+// UsteerDriftWarnings devuelve advertencias de inconsistencia legibles para la UI.
+func UsteerDriftWarnings(d UsteerDesired, sc UsteerScenario) []string {
+	d = normalizeUsteerDesired(d)
+	var warns []string
+	if !sc.UsteerInstalled {
+		warns = append(warns, "usteer no esta instalado")
+	}
+	if !sc.HostapdDirOK {
+		warns = append(warns, "El directorio /var/run/hostapd no existe")
+	}
+	mdom := d.MobilityDomain
+	for _, s := range sc.SSIDs {
+		if s.Mode != "ap" {
+			continue
+		}
+		if d.SSID != "" && s.SSID != d.SSID {
+			continue
+		}
+		if mdom != "" && s.MobilityDomain != mdom {
+			warns = append(warns, "Dominio de movilidad inconsistente en "+s.Section)
+		}
+		if s.IEEE80211K != "1" {
+			warns = append(warns, "802.11k desactivado en "+s.Section)
+		}
+		if s.IEEE80211R != "1" {
+			warns = append(warns, "802.11r desactivado en "+s.Section)
+		}
+		if s.IEEE80211V != "1" {
+			warns = append(warns, "802.11v desactivado en "+s.Section)
+		}
+	}
+	for _, r := range sc.Radios {
+		if r.RandomBSSID != "0" {
+			warns = append(warns, "random_bssid activo en "+r.Section)
+		}
+	}
+	return warns
+}
+
+// UsteerMethod devuelve active/inactive para la UI.
+func UsteerMethod(sc UsteerScenario) string {
+	if sc.UsteerRunning {
+		return "active"
+	}
+	return "inactive"
+}
+
+// Int helpers para comparar valores numericos si fuese necesario.
+func usteerInt(s string) int {
+	v, _ := strconv.Atoi(strings.TrimSpace(s))
+	return v
+}
+
+func validateUsteerOps(ops []executor.Op) error {
+	for _, op := range ops {
+		if err := executor.Validate(op); err != nil {
+			return fmt.Errorf("%s: %w", op.Desc, err)
+		}
+	}
+	return nil
+}

+ 242 - 0
server-go/internal/orchestr/usteer_test.go

@@ -0,0 +1,242 @@
+package orchestr
+
+import (
+	"strings"
+	"testing"
+
+	"github.com/gnacho/netpulse/agent/executor"
+)
+
+const usteerProbeApkOK = `===PKG_MGR===
+apk
+===USTEER_INST===
+yes
+===USTEER_RUN===
+yes
+===WPAD===
+wpad-mbedtls-2025.05.11~5.5.11-1 aarch64_cortex-a53 {wpad} () installed
+===HOSTAPD_DIR===
+yes
+===USTEER_UCI===
+usteer.@usteer[0]=usteer
+usteer.@usteer[0].enabled='1'
+usteer.@usteer[0].network='lan'
+usteer.@usteer[0].syslog='1'
+usteer.@usteer[0].debug_level='2'
+usteer.@usteer[0].aggressiveness='3'
+usteer.@usteer[0].band_steering_threshold='5'
+usteer.@usteer[0].load_balancing_threshold='0'
+usteer.@usteer[0].min_connect_snr='0'
+usteer.@usteer[0].min_snr='0'
+usteer.@usteer[0].roam_trigger_snr='0'
+usteer.@usteer[0].roam_scan_snr='0'
+===WIRELESS_UCI===
+wireless.temiscira2g=wifi-iface
+wireless.temiscira2g.device='radio0'
+wireless.temiscira2g.mode='ap'
+wireless.temiscira2g.ssid='temiscira'
+wireless.temiscira2g.ieee80211k='1'
+wireless.temiscira2g.ieee80211r='1'
+wireless.temiscira2g.ieee80211v='1'
+wireless.temiscira2g.bss_transition='1'
+wireless.temiscira2g.ft_over_ds='0'
+wireless.temiscira2g.ft_psk_generate_local='1'
+wireless.temiscira2g.mobility_domain='2025'
+wireless.radio0=wifi-device
+wireless.radio0.random_bssid='0'
+===END===`
+
+const usteerProbeOpkgMissing = `===PKG_MGR===
+opkg
+===USTEER_INST===
+no
+===USTEER_RUN===
+no
+===WPAD===
+wpad-basic - 2024.03.09~695a0ff9-1 - wpad-basic
+===HOSTAPD_DIR===
+no
+===USTEER_UCI===
+===WIRELESS_UCI===
+wireless.temiscira2g=wifi-iface
+wireless.temiscira2g.device='radio0'
+wireless.temiscira2g.mode='ap'
+wireless.temiscira2g.ssid='temiscira'
+wireless.temiscira2g.ieee80211k='0'
+wireless.temiscira2g.ieee80211r='0'
+wireless.temiscira2g.ieee80211v='0'
+wireless.temiscira2g.mobility_domain='2021'
+wireless.radio0=wifi-device
+wireless.radio0.random_bssid='1'
+===END===`
+
+func TestParseUsteerApkOK(t *testing.T) {
+	sc := parseUsteer(usteerProbeApkOK)
+	if sc.Manager != "apk" {
+		t.Errorf("Manager: got %q want apk", sc.Manager)
+	}
+	if !sc.UsteerInstalled {
+		t.Error("UsteerInstalled: esperaba true")
+	}
+	if !sc.UsteerRunning {
+		t.Error("UsteerRunning: esperaba true")
+	}
+	if sc.WpadVariant != "mbedtls" {
+		t.Errorf("WpadVariant: got %q want mbedtls", sc.WpadVariant)
+	}
+	if !sc.HostapdDirOK {
+		t.Error("HostapdDirOK: esperaba true")
+	}
+	if sc.Config["aggressiveness"] != "3" {
+		t.Errorf("aggressiveness: got %q want 3", sc.Config["aggressiveness"])
+	}
+	if sc.Config["band_steering_threshold"] != "5" {
+		t.Errorf("band_steering_threshold: got %q want 5", sc.Config["band_steering_threshold"])
+	}
+	if len(sc.SSIDs) != 1 {
+		t.Fatalf("SSIDs: got %d want 1", len(sc.SSIDs))
+	}
+	if sc.SSIDs[0].MobilityDomain != "2025" {
+		t.Errorf("mobility_domain: got %q want 2025", sc.SSIDs[0].MobilityDomain)
+	}
+	if len(sc.Radios) != 1 {
+		t.Fatalf("Radios: got %d want 1", len(sc.Radios))
+	}
+	if sc.Radios[0].RandomBSSID != "0" {
+		t.Errorf("random_bssid: got %q want 0", sc.Radios[0].RandomBSSID)
+	}
+}
+
+func TestParseUsteerOpkgMissing(t *testing.T) {
+	sc := parseUsteer(usteerProbeOpkgMissing)
+	if sc.Manager != "opkg" {
+		t.Errorf("Manager: got %q want opkg", sc.Manager)
+	}
+	if sc.UsteerInstalled {
+		t.Error("UsteerInstalled: esperaba false")
+	}
+	if sc.WpadVariant != "basic" {
+		t.Errorf("WpadVariant: got %q want basic", sc.WpadVariant)
+	}
+	if len(sc.SSIDs) != 1 || sc.SSIDs[0].IEEE80211K != "0" {
+		t.Error("esperaba 802.11k desactivado")
+	}
+	if sc.Radios[0].RandomBSSID != "1" {
+		t.Error("esperaba random_bssid=1")
+	}
+}
+
+func TestUsteerOpsInstallAndConfigure(t *testing.T) {
+	sc := parseUsteer(usteerProbeOpkgMissing)
+	ops := UsteerOps(UsteerDesired{
+		Enabled: true, SSID: "temiscira", MobilityDomain: "2025",
+	}, sc)
+	if err := validateUsteerOps(ops); err != nil {
+		t.Fatalf("ops no validan: %v", err)
+	}
+	kinds := usteerKindsOf(ops)
+	if !strings.Contains(kinds, "install") {
+		t.Error("falta install de usteer")
+	}
+	if !strings.Contains(kinds, "uci_set_named") {
+		t.Error("falta uci_set_named para la sección usteer")
+	}
+	if !strings.Contains(kinds, "uci_set") {
+		t.Error("falta uci_set")
+	}
+	if !strings.Contains(kinds, "uci_commit") {
+		t.Error("falta uci_commit")
+	}
+	if !strings.Contains(kinds, "service") {
+		t.Error("falta service start/enable")
+	}
+	// Debe forzar wpad completo en opkg.
+	foundWpad := false
+	for _, o := range ops {
+		if o.Kind == "install" && o.Args["package"] == "wpad-wolfssl" {
+			foundWpad = true
+		}
+	}
+	if !foundWpad {
+		t.Error("falta install de wpad-wolfssl al tener wpad-basic")
+	}
+	// Debe activar 802.11k/r/v.
+	found80211r := false
+	for _, o := range ops {
+		if o.Kind == "uci_set" && o.Args["config"] == "wireless" && o.Args["option"] == "ieee80211r" && o.Args["value"] == "1" {
+			found80211r = true
+		}
+	}
+	if !found80211r {
+		t.Error("falta uci_set ieee80211r=1")
+	}
+	// Debe poner random_bssid=0.
+	foundRandom := false
+	for _, o := range ops {
+		if o.Kind == "uci_set" && o.Args["option"] == "random_bssid" && o.Args["value"] == "0" {
+			foundRandom = true
+		}
+	}
+	if !foundRandom {
+		t.Error("falta uci_set random_bssid=0")
+	}
+}
+
+func TestUsteerOpsNoOpWhenMatches(t *testing.T) {
+	sc := parseUsteer(usteerProbeApkOK)
+	ops := UsteerOps(UsteerDesired{
+		Enabled: true, SSID: "temiscira", MobilityDomain: "2025",
+	}, sc)
+	if len(ops) != 0 {
+		t.Errorf("esperaba 0 ops cuando todo coincide, got %d: %v", len(ops), ops)
+	}
+}
+
+func TestUsteerOpsDisable(t *testing.T) {
+	sc := parseUsteer(usteerProbeApkOK)
+	ops := UsteerOps(UsteerDesired{Enabled: false}, sc)
+	if err := validateUsteerOps(ops); err != nil {
+		t.Fatalf("ops disable no validan: %v", err)
+	}
+	found := false
+	for _, o := range ops {
+		if o.Kind == "uci_set" && o.Args["option"] == "enabled" && o.Args["value"] == "0" {
+			found = true
+		}
+	}
+	if !found {
+		t.Error("disable no pone enabled=0")
+	}
+}
+
+func TestUsteerDriftWarnings(t *testing.T) {
+	sc := parseUsteer(usteerProbeOpkgMissing)
+	warns := UsteerDriftWarnings(UsteerDesired{Enabled: true, SSID: "temiscira", MobilityDomain: "2025"}, sc)
+	joined := strings.Join(warns, ",")
+	if !strings.Contains(joined, "usteer no esta instalado") {
+		t.Error("falta advertencia de usteer no instalado")
+	}
+	if !strings.Contains(joined, "random_bssid activo") {
+		t.Error("falta advertencia de random_bssid")
+	}
+	if !strings.Contains(joined, "802.11k desactivado") {
+		t.Error("falta advertencia de 802.11k")
+	}
+}
+
+func TestUsteerMethod(t *testing.T) {
+	if UsteerMethod(UsteerScenario{UsteerRunning: true}) != "active" {
+		t.Error("method active")
+	}
+	if UsteerMethod(UsteerScenario{}) != "inactive" {
+		t.Error("method inactive")
+	}
+}
+
+func usteerKindsOf(ops []executor.Op) string {
+	out := make([]string, len(ops))
+	for i, o := range ops {
+		out[i] = o.Kind
+	}
+	return strings.Join(out, ",")
+}

+ 28 - 3
server-go/internal/roamevents/collector.go

@@ -118,7 +118,7 @@ func (c *Collector) tick() {
 
 func (c *Collector) collectRouter(h RouterHost) {
 	// grep extiende el set a futuro (eventos FT, etc.) sin tocar el binario.
-	cmd := "logread 2>/dev/null | grep -E 'AP-STA-CONNECTED|AP-STA-DISCONNECTED|dawn:' | tail -100"
+	cmd := "logread 2>/dev/null | grep -E 'AP-STA-CONNECTED|AP-STA-DISCONNECTED|dawn:|usteer:' | tail -100"
 	out, err := c.runner.Run(h.Host, cmd, 8*time.Second)
 	if err != nil {
 		return
@@ -203,9 +203,9 @@ var (
 	// syslog formato completo: "Sat Aug  8 19:21:45 2026 daemon.notice hostapd: <resto>".
 	// Weekday opcional (algunos sistemas lo omiten). Múltiples espacios
 	// entre día y mes en logread de OpenWrt (alineación).
-	syslogRe = regexp.MustCompile(`^(?:\w{3}\s+)?(\w{3})\s+(\d+)\s+(\d{2}):(\d{2}):(\d{2})\s+\d{4}\s+daemon\.\w+\s+(\w+):\s+(.+)$`)
+	syslogRe = regexp.MustCompile(`^(?:\w{3}\s+)?(\w{3})\s+(\d+)\s+(\d{2}):(\d{2}):(\d{2})\s+\d{4}\s+(?:daemon|user)\.\w+\s+(\w+):\s+(.+)$`)
 	// Variante sin año: "Sat Aug  8 19:21:45 daemon.notice hostapd: <resto>".
-	syslogNoYearRe = regexp.MustCompile(`^(?:\w{3}\s+)?(\w{3})\s+(\d+)\s+(\d{2}):(\d{2}):(\d{2})\s+daemon\.\w+\s+(\w+):\s+(.+)$`)
+	syslogNoYearRe = regexp.MustCompile(`^(?:\w{3}\s+)?(\w{3})\s+(\d+)\s+(\d{2}):(\d{2}):(\d{2})\s+(?:daemon|user)\.\w+\s+(\w+):\s+(.+)$`)
 
 	// hostapd: "<iface>: AP-STA-CONNECTED <iface2> <mac>"
 	hostapdConnRe = regexp.MustCompile(`^(\S+):\s+AP-STA-(CONNECTED|DISCONNECTED)\s+\S+\s+([0-9a-fA-F:]{17})`)
@@ -214,6 +214,10 @@ var (
 
 	// dawn: "Client / BSSID = <mac> / <bssid>: <action>"
 	dawnClientRe = regexp.MustCompile(`Client\s*/\s*BSSID\s*=\s*([0-9a-fA-F:]{17})\s*/\s*([0-9a-fA-F:]{17}):\s*(.+)`)
+
+	// usteer: "station <mac> connected to node <node>" /
+	//         "station <mac> disconnected from node <node>"
+	usteerStationRe = regexp.MustCompile(`station\s+([0-9a-fA-F:]{17})\s+(connected to|disconnected from)\s+node\s+(\S+)`)
 )
 
 // ParseLogreadLine intenta parsear una línea de logread a un Event.
@@ -250,6 +254,12 @@ func ParseLogreadLine(line, routerID string) (Event, bool) {
 			return Event{}, false
 		}
 		return ev, true
+	case "usteer":
+		ev, ok := parseUsteer(rest, routerID, ts)
+		if !ok {
+			return Event{}, false
+		}
+		return ev, true
 	}
 	return Event{}, false
 }
@@ -290,6 +300,21 @@ func parseDawn(rest, routerID string, ts int64) (Event, bool) {
 	return Event{}, false
 }
 
+// parseUsteer parsea las líneas de usteer: "station <mac> connected to node
+// <node>" o "station <mac> disconnected from node <node>". Mapea a
+// connected/disconnected (mismos tipos que hostapd).
+func parseUsteer(rest, routerID string, ts int64) (Event, bool) {
+	if m := usteerStationRe.FindStringSubmatch(rest); m != nil {
+		mac := m[1]
+		typ := TypeConnected
+		if m[2] == "disconnected from" {
+			typ = TypeDisconnected
+		}
+		return Event{TsMs: ts, RouterID: routerID, Type: typ, MAC: mac, Detail: "node " + m[3]}, true
+	}
+	return Event{}, false
+}
+
 var months = map[string]int{
 	"Jan": 1, "Feb": 2, "Mar": 3, "Apr": 4, "May": 5, "Jun": 6,
 	"Jul": 7, "Aug": 8, "Sep": 9, "Oct": 10, "Nov": 11, "Dec": 12,

+ 36 - 0
server-go/internal/roamevents/collector_test.go

@@ -39,6 +39,42 @@ func TestParseLogreadFlint2(t *testing.T) {
 	}
 }
 
+// TestParseUsteer cubre las líneas de usteer (user.info usteer:) con
+// "station MAC connected/disconnected to/from node".
+func TestParseUsteer(t *testing.T) {
+	cases := []struct {
+		line string
+		want string
+		mac  string
+	}{
+		{
+			"Sat Aug  8 19:21:58 2026 user.info usteer: station 04:95:e6:76:55:a1 connected to node 04:95:e6:76:55:b2",
+			TypeConnected,
+			"04:95:e6:76:55:a1",
+		},
+		{
+			"Sat Aug  8 19:21:59 2026 user.info usteer: station 04:95:e6:76:55:a1 disconnected from node 04:95:e6:76:55:b2",
+			TypeDisconnected,
+			"04:95:e6:76:55:a1",
+		},
+	}
+	for _, tc := range cases {
+		ev, ok := ParseLogreadLine(tc.line, "rt3")
+		if !ok {
+			t.Fatalf("línea usteer debería parsear: %q", tc.line)
+		}
+		if ev.Type != tc.want {
+			t.Errorf("type = %q, want %q", ev.Type, tc.want)
+		}
+		if ev.MAC != tc.mac {
+			t.Errorf("mac = %q, want %q", ev.MAC, tc.mac)
+		}
+		if ev.Detail == "" || !contains(ev.Detail, "node") {
+			t.Errorf("detail = %q", ev.Detail)
+		}
+	}
+}
+
 // TestParseHostapdConnected cubre las dos variantes (con y sin segundo iface).
 func TestParseHostapdConnected(t *testing.T) {
 	cases := []struct {