UniFi - Guest Portal Promotional URL Automatic Redirection

Overview

Readers will learn how to customize the built-in UniFi portal to automatically redirect guests to the Promotional URL/Site without doing anything, but connecting to the AP/Guest WiFi. 

Prerequisites

*User must have UniFi Controller installed.

*User must have a Guest Network setup.

*UniFi Controller v4+

**Some commands below may require escalated permissions, so I would recommend running the command "sudo -s" The following command will put you into a root shell allowing you to execute commands with root-level permissions.

Settings in the UniFi Controller

Step 1: Open the Settings tab in the UniFi Controller

Step 2: Click on the Guest Control tab on the right-hand side

Step 3: Enable Guest Portal by clicking the checkbox

Step 4: Set the Authentication type to "No Authentication"

Step 5: Set the Landing Page to Promotional URL.

Step 6: Enable Portal Customization by clicking the checkbox

Step 7: Click the Apply button at the bottom right-hand side.

Modifying the Portal(Linux)

Step 1: Navigate to the /var/lib/unifi/sites/default/portal/ with command "cd /var/lib/unifi/sites/default/portal/"

Step 2: Move "index.html" to "index.html.orig" for backup purposes with command "mv index.html index.html.orig"

Step 3: Now using your favorite editor(nano, vi, gedit, etc) create a new file index.html with command "vi index.html"

Step 4: Go to the following Gist and copy the index.html code into your editor:

https://gist.github.com/devinbabb/98055cdb74c80263ed97

Step 5: Save the file if using vi "hit esc :wq enter" vi specific, make this generic

Step 6: Now restart the UniFi Service by running the following command "service unifi reload"

When a guest connects to the guest network the guest will automatically be authorized and redirected to your promotional URL without accepting the Terms & Conditions. If you need any assistance with this feel free to send me a PM!

A new feature introduced in UniFi version 3 is Multi-Site Management.  This allows you to have multiple logically separated "sites" to manage groups of UAPs.  For example, you could have a building on the East coast and one on the West coast, each needing different SSIDs or security protocols, but you want to manage them from a single controller.

To create a new site:

  1. You'll see a Site dropdown across towards the top of the UniFi controller interface.  It will be by the AP and Station count as shown: 
  2. Click the dropdown and choose New Site...
  3. Enter a unique 3-24 character ID for the site
  4. Enter a unique name for the Site.  Note: this will be the text that appears in the Site dropdown
  5. Click Save

Now you should have a Default site and whatever you chose for step #4 above listed in the Sites dropdown.

You can now plug in your UAPs to your network or perform a Layer 3 adoption as necessary if the UAPs are on a separate subnet from the controller.

The UAPs should now appear as "Pending Approval" in all Sites.  Choose the Site that you would like to adopt the UAP on to via the Sites dropdown, then click the Adopt button.  Once the UAP is Adopted and Provisioned, it will only appear on the Site you where you Adopted it.

 

Powered by Zendesk