OPNsense Forum

Archive => 16.7 Legacy Series => Topic started by: enpe on November 25, 2016, 12:37:17 pm

Title: [SOLVED] How to run the UniFi controller on OPNsense boxes?
Post by: enpe on November 25, 2016, 12:37:17 pm
I used to run an older version of the UniFi controller (https://community.ubnt.com/t5/UniFi-Updates-Blog/UniFi-5-2-9-is-released/ba-p/1694199) on my pfSense box. Now I switched
to OPNsense. Not suprisingly, the installation guide (http://community.ubnt.com/t5/UniFi-Wireless/Tutorial-UniFi-3-1-4-running-on-pfSense-2-1-RC/td-p/539534) I used back then doesn't work with
OPNsense. So, that's why I'm here now.

Just as a sidenote, my installation of OPNsense 16.7 is still pretty much in vanilla state.

According to the README that comes with UniFi.unix.zip (version 5.2.9) (http://www.ubnt.com/downloads/unifi/5.2.9/UniFi.unix.zip) the software has
the following minimum requirements:
I checked my /etc/pkg/FreeBSD.conf:

Code: [Select]
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}

The above online archive of FreeBSD 10.3 contains both packages and so I thought that the following commands would have
been enough:

Code: [Select]
pkg update
pkg install mongodb openjdk-jre-7

Unfortunetaly, I was wrong; these packages cannot be found. So, my guess is that OPNsense
uses a different software repository and that it's configuration works differently.

What am I doing wrong? Any suggestions on how I can solve this (probably simple) problem?
Title: Re: How to run the UniFi controller on OPNsense boxes?
Post by: franco on November 25, 2016, 01:00:52 pm
We're using the FreeBSD-style disable of their repository:

https://github.com/opnsense/src/blob/master/etc/pkg/FreeBSD.conf#L3-L4

If you delete the file /usr/local/etc/pkg/repos/FreeBSD.conf the FreeBSD mirror will be available.

Be prepared for problems as we build our packages against LibreSSL and OpenSSL from ports, which is incompatible with the way FreeBSD builds their packages (OpenSSL from base).

When you have your packages, make sure to disable the repository again. Pkg is greedy when it comes to upgrading. It will gladly take any newer package from FreeBSD and try do deinstall anything that is not compatible. Here be dragons. ;)


Cheers,
Franco
Title: Re: How to run the UniFi controller on OPNsense boxes?
Post by: enpe on November 25, 2016, 08:15:23 pm
That was it! Thanks for pointing into the right direction.
Title: Re: [SOLVED] How to run the UniFi controller on OPNsense boxes?
Post by: tillsense on November 28, 2016, 07:52:21 pm
@ enpe,

UniFI on pfsense or opnsense? this setup interests me, you have here also a USG in the employment?

cheers till
Title: Re: [SOLVED] How to run the UniFi controller on OPNsense boxes?
Post by: enpe on December 01, 2016, 09:18:03 pm
Quote
UniFI on pfsense or opnsense? this setup interests me, you have here also a USG in the employment?

The UniFi controller worked on pfSense. But since I moved to OPNsense I was asking about how to install the UniFi controller on OPNsense. I'm not using any UniFi Security Gateways (USG).

Franco's suggestion worked and I managed to install and run the controller. Unfortunately, the linking between the controller and the access points fails (adoption in UniFi speak). I don't have the exact error message at hand anymore but it was related to the encrypted communication (Franco: SSL --> "there be dragons!"). Until I find a solution to that problem I will be running the controller on a standard Linux machine.
Title: Re: [SOLVED] How to run the UniFi controller on OPNsense boxes?
Post by: franco on December 05, 2016, 05:30:27 pm
You could build the packages from the box via the ports tree in a native fashion:

# opnsense-code ports
# cd /etc
# fetch https://raw.githubusercontent.com/opnsense/tools/master/config/16.7/make.conf
# cd /usr/ports/port/to/use
# make all install PRODUCT_FLAVOUR=OpenSSL

Switch PRODUCT_FLAVOUR=LibreSSL for LibreSSL...

Which packages are required, I can check their deps and see if we could include them , but I can't promise it as we don't want to considerably burden our package builds and download channels too much.


Cheers,
Franco
Title: Re: [SOLVED] How to run the UniFi controller on OPNsense boxes?
Post by: weust on December 06, 2016, 12:41:13 am
I actually has UniFi running on FreeBSD. But since it's more a hobby approach, since there is no official support/package from UbiQuiti, I switched to Linux. Which is officially supported.

Installing was one thing, upgrading was a PITA.
Title: Re: [SOLVED] How to run the UniFi controller on OPNsense boxes?
Post by: tillsense on July 06, 2017, 07:17:42 am
These guys have a sh script for pfsense. If the topic is still interesting.

https://forum.opnsense.org/index.php?topic=5469.0 (https://forum.opnsense.org/index.php?topic=5469.0)
Edit: move to Development and Code Review Forum

cheers till