Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - amd989

#1
Development and Code Review / UniFi Gateway emulator
March 30, 2026, 08:26:17 PM
Hey all,

Like many of you I run UniFi APs and switches but use my own router (OPNSense in my case). The one thing that always bugged me was the missing gateway in the UniFi controller. No topology, no WAN stats, just a hole where a USG should be.

Thanks to the brilliant efforts of others before me, the inform protocol got reversed-engineered. Some work started to get a working emulator but nothing concrete materialized over the last ten years. Sadly, lots of abandoned projects.

A reddit post recently reminded me of this topic and after looking back and seeing nothing, I decided to take a stab at it.

I've been working on a small daemon that emulates a UGW3. It speaks the actual inform protocol (TNBU binary, AES encryption, the whole thing) so the controller genuinely thinks there's a USG on the network. You get interface stats, traffic counters, connected clients, DHCP leases, CPU/mem, latency, all showing up in the dashboard like a real gateway.

It currently runs on:

  • Linux (Debian, Ubuntu, RHEL, etc.) - apt/dnf repos available
  • FreeBSD / OPNSense / pfSense - pkg repo available
  • OpenWRT - opkg repo available
  • Docker - if you just want to throw it on whatever box
  • There are also standalone binaries (x86_64, ARM64, ARMv7) if you don't want to mess with Python.

Setup is basically: install, point it at your controller's inform URL, adopt it like any other device, and run. The config file just maps your real interfaces (like eth0, br-lan, whatever) to the emulated USG ports.

It supports dnsmasq, ISC dhcpd, and KEA lease formats out of the box. Platform-specific stuff (ARP tables, routing, neighbors) is handled automatically based on your OS.

It is still a work in progress. I'm working on deeper API integrations for OPNSense and OpenWRT so it can pull richer data (per-device traffic from Netflow, manufacturer info from ARP, etc.) and eventually push config back from the controller to the router (DHCP reservations, port forwards, DNS overrides).

Repo: https://github.com/amd989/unifi-gateway

Would love for people to try it out and let me know what breaks. Issues and PRs welcome.


Disclaimer: I've used AI code assisting tools to get well ahead I would have done on my own, so if that doesn't rock your boat, just skip this one.