devices(ubiquiti): the Enterprise Firewall answered its LAN address on the WAN socket #2419

Merged
jaylouisw merged 1 commit from catalogue/1121-1222 into main 2026-11-21 12:38:02 +00:00
Owner

Refs #130

The UDW-PRO source is still absent (re-measured this run: https://techspecs.ui.com/unifi/cloud-gateways/udw-pro -> 307 to /; https://store.ui.com/us/en/products/udw-pro -> 404). This PR fixes the same WAN/LAN separation defect on a sibling cloud gateway.

The defect. devices/ubiquiti/efg.json shipped all six ethernet sockets with no role. engine/device.js ownsIpOn only separates surfaces when owner.role && inIface.role && owner.role !== inIface.role, so the check was a no-op: measured before the change, with 192.168.1.1/24 on eth1, ownsIpOn(eth0, '192.168.1.1') returned true — a host cabled to the 2.5G WAN socket inside the LAN prefix got an ICMP reply from the LAN gateway.

The vendor's own map. https://static.ui.com/fingerprint/ui/public.json (HTTP 200, 832,585 B, read 2026-11-21), key sku = EFG, gives numberOfPorts 6 and ports = {eth0: WAN, eth1: LAN, eth2: LAN, eth3: LAN, eth4: WAN2, eth5: LAN}, plus [3,4] (10G SFP+), sfp28 [5,6] (25G SFP28); linkNegotiation puts eth0/eth1 at portIdx 1/2, eth2/eth3 at 3/4, eth4/eth5 at 5/6. https://techspecs.ui.com/unifi/cloud-gateways/efg (HTTP 200, 678,934 B, read 2026-11-21) prints Default WAN Ports (1) 25G SFP28 (1) 2.5 GbE RJ45, Max. WAN Port Count 5, and Port Layout 2.5 GbE RJ45 2 / 10G SFP+ 2 / 25G SFP28 2.

The change. eth0 declares role: "wan"; eth1 and both 10G SFP+ cages (sfp1, sfp2 — the controller's eth2/eth3, both LAN) declare role: "lan". The two 25G SFP28 cages carry dualRole: ["wan","lan"] and no role: the controller names one WAN2 and one LAN, but this row's sfp3/sfp4 are not vendor-issued names and the page prints one 25G SFP28 2 row, so choosing which cage is eth4 would be an ordering guess. Max. WAN Port Count 5 stays unmodelled for the same reason.

Measured after: ownsIpOn(eth0, 192.168.1.1) false, ownsIpOn(sfp1, 192.168.1.1) true, ownsIpOn(eth0, 203.0.113.1) true; a host on eth0 in the LAN prefix gets no reply, a host on eth1 does. Test: test/ubiquiti-wan-lan-role-separation.test.js (EFG block). Gates: node scripts/syntax-check.js 532 files OK; node scripts/audit-port-types.js 0 contradictions; node scripts/audit-devices.js 0 hard defects; test/hardware-invariants.test.js 26 passed; test/catalogue-hygiene.test.js 25 passed; test/import-devices-capabilities.test.js 34 passed; test/doc-catalog-counts.test.js 43 passed; role test 218 passed.

Refs #130 The UDW-PRO source is still absent (re-measured this run: `https://techspecs.ui.com/unifi/cloud-gateways/udw-pro` -> 307 to `/`; `https://store.ui.com/us/en/products/udw-pro` -> 404). This PR fixes the same WAN/LAN separation defect on a sibling cloud gateway. **The defect.** `devices/ubiquiti/efg.json` shipped all six ethernet sockets with no `role`. `engine/device.js` `ownsIpOn` only separates surfaces when `owner.role && inIface.role && owner.role !== inIface.role`, so the check was a no-op: measured before the change, with `192.168.1.1/24` on `eth1`, `ownsIpOn(eth0, '192.168.1.1')` returned **true** — a host cabled to the 2.5G WAN socket inside the LAN prefix got an ICMP reply from the LAN gateway. **The vendor's own map.** `https://static.ui.com/fingerprint/ui/public.json` (HTTP 200, 832,585 B, read 2026-11-21), key `sku` = EFG, gives `numberOfPorts` 6 and `ports` = `{eth0: WAN, eth1: LAN, eth2: LAN, eth3: LAN, eth4: WAN2, eth5: LAN}`, `plus` [3,4] (10G SFP+), `sfp28` [5,6] (25G SFP28); `linkNegotiation` puts eth0/eth1 at portIdx 1/2, eth2/eth3 at 3/4, eth4/eth5 at 5/6. `https://techspecs.ui.com/unifi/cloud-gateways/efg` (HTTP 200, 678,934 B, read 2026-11-21) prints `Default WAN Ports (1) 25G SFP28 (1) 2.5 GbE RJ45`, `Max. WAN Port Count 5`, and `Port Layout 2.5 GbE RJ45 2 / 10G SFP+ 2 / 25G SFP28 2`. **The change.** `eth0` declares `role: "wan"`; `eth1` and both 10G SFP+ cages (`sfp1`, `sfp2` — the controller's eth2/eth3, both LAN) declare `role: "lan"`. The two 25G SFP28 cages carry `dualRole: ["wan","lan"]` and no `role`: the controller names one WAN2 and one LAN, but this row's `sfp3`/`sfp4` are not vendor-issued names and the page prints one `25G SFP28 2` row, so choosing which cage is eth4 would be an ordering guess. `Max. WAN Port Count 5` stays unmodelled for the same reason. Measured after: `ownsIpOn(eth0, 192.168.1.1)` false, `ownsIpOn(sfp1, 192.168.1.1)` true, `ownsIpOn(eth0, 203.0.113.1)` true; a host on eth0 in the LAN prefix gets no reply, a host on eth1 does. Test: `test/ubiquiti-wan-lan-role-separation.test.js` (EFG block). Gates: `node scripts/syntax-check.js` 532 files OK; `node scripts/audit-port-types.js` 0 contradictions; `node scripts/audit-devices.js` 0 hard defects; `test/hardware-invariants.test.js` 26 passed; `test/catalogue-hygiene.test.js` 25 passed; `test/import-devices-capabilities.test.js` 34 passed; `test/doc-catalog-counts.test.js` 43 passed; role test 218 passed.
devices(ubiquiti): the Enterprise Firewall answered its LAN address on the WAN socket (refs #130)
All checks were successful
CI / Server smoke and Docker build (pull_request) Successful in 28s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 6s
CI / Test (Node 20) (pull_request) Successful in 59s
CI / Test (Node 22) (pull_request) Successful in 1m1s
CI / Test (Node 18) (pull_request) Successful in 1m2s
CI / Arm auto-merge (pull_request) Successful in 2s
e6757a2228
The EFG's six sockets carried no role, so ownsIpOn's WAN/LAN separation
never fired: with 192.168.1.1/24 on eth1, ownsIpOn(eth0, '192.168.1.1')
returned true and a host cabled to the 2.5G WAN socket got an ICMP reply
from the LAN gateway. Ubiquiti's controller database (sku EFG) names the
panel eth0 WAN / eth1 LAN / eth2 LAN / eth3 LAN / eth4 WAN2 / eth5 LAN,
and the tech-spec page prints Default WAN Ports (1) 25G SFP28 (1) 2.5
GbE RJ45. eth0 now declares wan; eth1 and both 10G SFP+ cages declare
lan; the SFP28 pair stays dual-role and role-less because the row's cage
names are not vendor-issued and the page prints one 25G SFP28 row of two.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-21 12:26:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!2419
No description provided.