nextdns / nextdns

NextDNS CLI client (DoH Proxy)
https://nextdns.io
MIT License
3.22k stars 198 forks source link

Support for Unifi Gateway Lite #889

Closed jdloft closed 9 months ago

jdloft commented 11 months ago

New UI Gateway dropped and the CLI doesn't seem to detect it as a Unifi device. Looks like the client currently looks for the /data/unifi path (relevant line) but on my device I have:

# ls /data/
dpi-tracer/  udapi-config/  ui-db/  uxgpro-setup/  wifiman/

However, the CLI does install correctly, but conflicts with the dnsmasq on port 53 from ubios-udapi-server. Are there any plans to support this device?

Update: Looks like I only needed to create the dir /data/unifi and everything worked.

itislp commented 10 months ago

I too am looking for this type of support. I was able to successfully install on the UXG-Lite running latest firmware but get an error "stuck in a failed state" upon status check.

Do you know if your workaround will persist across firmware updates? Thanks for posting this info, I am going to give it a try today to see if I can get it working as well.

rs commented 10 months ago

We need to fix the firmware detection first

rs commented 10 months ago

What does this command return on the router:

ubnt-device-info firmware
nxion commented 10 months ago

@rs That command returns

3.1.15
ralban commented 10 months ago

+1 for UXG-Lite support. 3.1.16 was just released.

bwestrek commented 10 months ago

For me it works also by creating first the folder /data/unifi and running the install script. So it looks like in the script needs small adjustment that it creates the folder /data/unifi first then the rest of the script. Running UXG version 3.1.16

rs commented 10 months ago

Please try this snapshot to confirm it works as expected:

NEXTDNS_VERSION=pr-899/SNAPSHOT-efee3d1 sh -c 'sh -c "$(curl -sL https://raw.githubusercontent.com/nextdns/nextdns/f106407bc9a8ee0c6f1c2917bedb246a8b16013b/install.sh)"'
ralban commented 10 months ago

I uninstalled my previous instance and installed this snapshot. It installed in the folder I was in when I ran the script (/data) and picked-up on my previous nextdns.conf. Should it be in a child folder (/data/nextdns)? It did not survive when I went from 3.1.15 to 3.1.16 with the previous stable build. I am already on 3.1.16 so I won't be able to test survivability until they release the next upgrade. image

rs commented 10 months ago

It should install the binary via the deb package with the config in the /data directory. Isn’t it what happened?

wprivera commented 10 months ago

Unifi UXG Pro UniFi OS v3.2.7 Initial install does not work. Traffic by device name is not listed in the NextDNS logs. I manually created the /data/unifi folders, and re-ran the install script. Still does not work. Any update on a fix?

Jan 04 04:07:27 UXG-Pro nextdns[77030]: Error: proxy: tcp: listen tcp :53: bind: address already in use Jan 04 04:07:27 UXG-Pro systemd[1]: nextdns.service: Main process exited, code=exited, status=1/FAILURE Jan 04 04:07:27 UXG-Pro systemd[1]: nextdns.service: Failed with result 'exit-code'. Jan 04 04:17:45 UXG-Pro systemd[1]: Started NextDNS DNS53 to DoH proxy.. Jan 04 04:17:45 UXG-Pro nextdns[90276]: Starting NextDNS 1.41.0/linux on :53 Jan 04 04:17:45 UXG-Pro nextdns[90276]: Starting mDNS discovery Jan 04 04:17:45 UXG-Pro nextdns[90276]: Listening on TCP/:53 Jan 04 04:17:45 UXG-Pro nextdns[90276]: Listening on UDP/:53 Jan 04 04:17:45 UXG-Pro nextdns[90276]: Startup failed: proxy: tcp: listen tcp :53: bind: address already in use

modxmv commented 10 months ago

Unifi UXG Pro UniFi OS v3.2.7 Initial install does not work. Traffic by device name is not listed in the NextDNS logs. I manually created the /data/unifi folders, and re-ran the install script. Still does not work. Any update on a fix?

Jan 04 04:07:27 UXG-Pro nextdns[77030]: Error: proxy: tcp: listen tcp :53: bind: address already in use Jan 04 04:07:27 UXG-Pro systemd[1]: nextdns.service: Main process exited, code=exited, status=1/FAILURE Jan 04 04:07:27 UXG-Pro systemd[1]: nextdns.service: Failed with result 'exit-code'. Jan 04 04:17:45 UXG-Pro systemd[1]: Started NextDNS DNS53 to DoH proxy.. Jan 04 04:17:45 UXG-Pro nextdns[90276]: Starting NextDNS 1.41.0/linux on :53 Jan 04 04:17:45 UXG-Pro nextdns[90276]: Starting mDNS discovery Jan 04 04:17:45 UXG-Pro nextdns[90276]: Listening on TCP/:53 Jan 04 04:17:45 UXG-Pro nextdns[90276]: Listening on UDP/:53 Jan 04 04:17:45 UXG-Pro nextdns[90276]: Startup failed: proxy: tcp: listen tcp :53: bind: address already in use

Experiencing the same issue myself

wprivera commented 10 months ago

The poster "RS" is Olivier Poitrey. He is the Co-Founder of NextDNS. He is actively working on a fix. Maybe follow him, for when he posts an update. He posted the following in "Add support for UXG series of Unifi product #899"

You did not test the snapshot. Please make sure to copy the whole command:

NEXTDNS_VERSION=pr-899/SNAPSHOT-efee3d1 sh -c 'sh -c "$(curl -sL https://raw.githubusercontent.com/nextdns/nextdns/f106407bc9a8ee0c6f1c2917bedb246a8b16013b/install.sh)"'

It did not work for me, but that is what he instructed. It is an unreleased test version. I'm sure he'll post an update soon.

modxmv commented 10 months ago

I ran the test snapshot and it appears to be working

root@UXG-Lite:/# NEXTDNS_VERSION=pr-899/SNAPSHOT-efee3d1 sh -c 'sh -c "$(curl -sL https://raw.githubusercontent.com/nextdns/nextdns/f106407bc9a8ee0c6f1c2917bedb246a8b16013b/install.sh)"' INFO: OS: debian INFO: GOARCH: arm64 INFO: GOOS: linux INFO: NEXTDNS_BIN: /usr/bin/nextdns INFO: INSTALL_RELEASE: pr-899/SNAPSHOT-efee3d1 u) Upgrade NextDNS from 1.41.0 to pr-899/SNAPSHOT-efee3d1 c) Configure NextDNS r) Remove NextDNS e) Exit Choice (default=u): u INFO: Upgrading NextDNS... NextDNS installed and started using ubios init c) Configure NextDNS r) Remove NextDNS e) Exit Choice (default=c): NextDNS Profile ID: 36f557 Sending your devices name lets you filter analytics and logs by device. Report device name? [Y|n]: y Make NextDNS CLI cache responses. This improves latency and reduces the amount of queries sent to NextDNS. Note that enabling this feature will disable dnsmasq for DNS to avoid double caching. Enable caching? (y/n): y Instant refresh will force low TTL on responses sent to clients so they rely on CLI DNS cache. This will allow changes on your NextDNS config to be applied on your LAN hosts without having to wait for their cache to expire. Enable instant refresh? (y/n): y NextDNS installed and started using ubios init c) Configure NextDNS r) Remove NextDNS e) Exit Choice (default=c): e root@UXG-Lite:/# root@UXG-Lite:/# root@UXG-Lite:/# nextdns status running root@UXG-Lite:/# image