Tuesday, 25 November 2014

Installing the Ubiquity UniFi software on ubuntu

This is shamelessly stolen from the following site and I have not tested it but wanted somewhere I could go that I knew I would be able to find the info.

https://community.ubnt.com/t5/UniFi-Updates-Blog/UniFi-3-2-7-is-released/ba-p/1085473

UniFi Controller APT howto
  1. edit /etc/apt/sources.list
    ## Ubuntu
    deb http://www.ubnt.com/downloads/unifi/distros/deb/ubuntu ubuntu ubiquiti
    
  2. add GPG Key
    # for Ubiquiti
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50
    
  3. update, install, and upgrade
    # retrieve the latest package information
    apt-get update
    apt-get install unifi
    
UniFi API
A shell library, unifi_sh_api is provided with the release. here's a sample script to authorize a guest for 30 minutes
#!/bin/sh
## define required variables
username=admin
password=admin
baseurl=https://localhost:8443
site=default
## include the API library
. unifi_sh_api
unifi_login
# authorize a client for 30 minutes, limit down/up speed to 2048/1024kbps, quota is 500MB
unifi_authorize_guest "e8:17:22:10:5d:4d" 30 down=2048 up=1024 bytes=500 
# generate 10 voucher(s) valid for 60 minutes, limit down/up speed to 2048/1024kbps, quota is 500MB
unifi_create_voucher 60 10 down=2048 up=1024 bytes=500
# this returns you a token that you can call by using unifi_get_vouchers()
unifi_logout
Notes
  1. AP->Performance view is experimental. Currently it shows what the radio is doing by red (packets not sent because of likely interference) / yellow (packets retried) / green (packets sent)
  2. voucher.css and voucher.html, at data/sites/SITE_NAME/portal/bundle/, is where you can fully customize your voucher.
  3. If you have existing customized guest portal, make sure to change form="/guest/login" to form="login" - let the relative path take care of per-site URL
  4. For API access, you pretty much need to insert /s/SITENAME into the URL. (after login with an admin in for site)

1 comment:

  1. This post is very meaningful and magnificent for us which you have shared here about the Ubiquity UniFi software. I really enjoyed reading it and also I will be back to read more in the future. If anyone looking to Buy Ubiquiti Unifi Ap, Visit ubiquiti.asia/en

    ReplyDelete