net/wol: check IPv6 NDP table (get_ndp) in dashboard widget for online status

Abierto Apto para principiantes
#5,976 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
62/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, php

Línea de trabajo

Empieza por net/wol/src/opnsense/www/js/widgets/WakeOnLan.js y su búsqueda ARP existente; después, revisa la entrada page-services-wakeonlan en net/wol/src/opnsense/mvc/app/models/OPNsense/Wol/ACL/ACL.xml. Añade la búsqueda NDP y permite su endpoint de API en la ACL; el widget debería indicar que un host está en línea cuando su MAC y la interfaz configurada coincidan en cualquiera de las dos tablas. El issue no menciona pruebas, así que revisa las comprobaciones de widgets cercanas para encontrar el proceso de verificación pertinente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.
On dual-stack interfaces where some target hosts communicate exclusively over IPv6 (IPv6-only hosts on a VLAN that still has an IPv4 broadcast address configured on OPNsense for sending L2 WoL magic packets), the Wake-on-LAN dashboard widget (WakeOnLan.js) always displays these hosts as Offline even when they are up and actively communicating with OPNsense.

This happens because WakeOnLan.js only queries /api/diagnostics/interface/get_arp (the IPv4 ARP table, arp -an) and never checks /api/diagnostics/interface/get_ndp (the IPv6 Neighbor Discovery table, ndp -an).

Observed on OPNsense 26.7.10 (os-wol 2.5_4):

  • arp -an has no entry for the host's MAC address.
  • ndp -an and /api/diagnostics/interface/get_ndp list the host's MAC as reachable (R/S) on the expected interface (intf_description matches item["%interface"]).

Describe the solution you'd like

  1. In net/wol/src/opnsense/www/js/widgets/WakeOnLan.js, query /api/diagnostics/interface/get_ndp alongside /api/diagnostics/interface/get_arp (e.g., via Promise.all) and mark a host as Online if it matches either:
    • a non-expired entry in the ARP table on the configured interface (note: using .some() as proposed in #5790 also handles MACs present on multiple interfaces), or
    • a matching entry in the NDP table (obj.mac.toLowerCase() === mac.toLowerCase() && obj.intf_description === intf).
  2. In net/wol/src/opnsense/mvc/app/models/OPNsense/Wol/ACL/ACL.xml, add <pattern>api/diagnostics/interface/get_ndp*</pattern> to page-services-wakeonlan (matching commit 0e62a49924 which added api/diagnostics/interface/get_arp*).

Describe alternatives you've considered

  • Assigning an IPv4 address to IPv6-only servers just to populate the ARP cache — undesirable in an IPv6-only server environment.
  • Optionally, note that list_ndp.py currently filters out (incomplete) entries and returns {mac, ip, intf, manufacturer} (plus intf_description added by InterfaceController::getNdpAction()), without exposing the NDP neighbor state (R/S/D/P) or expiration. If maintainers prefer distinguishing Reachable vs Stale/expired entries, that could be considered in opnsense/core (list_ndp.py) as a follow-up.

Additional context

  • Environment: OPNsense 26.7.10 (amd64), os-wol 2.5_4.
  • Related: #5790 (refactor of checkActive() in WakeOnLan.js from find() to some()), commit 0e62a49924 (ACL.xml pattern for get_arp*).
  • I'm happy to open a PR once the preferred approach is confirmed.
Lenguaje dominante
PHP
Estrellas
1.2k
Forks
926
Merge medio
1 d 10 h
PR fusionados (30 d)
25

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de opnsense/plugins

Todos los issues de opnsense/plugins

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.