- An SSH client for accessing your UniFi equipment. Common options include:
- PuTTY (Windows)
- Terminal (Built into macOS and Linux)
- Google Fiber Service:
- Active Google Fiber business subscription (Sign up here)
- Static IP block assignment from Google Fiber
- Google Fiber Router
- UniFi Controller
This guide has been tested and verified to work with the UniFi controllers listed in the "Tested Hardware" section below.
Setting Google Fiber Router to Bridge Mode
Before configuring your UniFi controller, you will need to set your Google Fiber router into Bridge mode. This allows your UniFi controller to handle routing functions for your connection.
-
Access your Google Fiber account:
- Open a web browser and navigate to https://fiber.google.com/account
- Sign in using your Google Fiber credentials
-
Navigate to "Use bridge mode":
- Click on the "Network" tab on the left
- Select the "Edit router settings" button
- Click on the "Router" tab on the left
- Enable the "Use bridge mode" option:
-
Restart your Google Fiber router:
- The router will need to be restarted to apply the changes
- This process typically takes 3-5 minutes
Setting Up Static IP Block on UniFi Controller
Now that your Google Fiber router is in Bridge mode, you will need to configure your UniFi controller to use the static IP block:
-
Log into your UniFi Controllers User Interface
- Open a web browser and navigate to your controller's IP address (eg. 192.168.0.1)
- Log in with your administrator credentials
-
Navigate to Internet Settings:
- Click on "Settings" in the left sidebar
- Select "Internet" from the left menu
- Select your WAN connection at the top
-
Enter Static IP Information
- Name: Google Fiber Business
- IPv4 Connection: Static IP
- IPv4 Address: Google Fiber Primary IP Address (Not one from your static IP block)
- Subnet Mask: Provided By Google Fiber
- Gateway IP: Provided By Google Fiber
- Additional IP Addresses:
- Add each address from your IP block in the format 0.0.0.0/00
- The /00 (CIDR notation) portion of the address is provided to you by Google Fiber.
- DNS Server: Unchecked
- Primary Server: 8.8.8.8
- Secondary Server: 8.8.4.4
- (OPTIONAL) Configure IPv6:
- IPv6 Connection: SLAAC
- IPv6 Type: Prefix Delegation
- Prefix Delegation Size: 56 (May be different for your connection)
- DNS Server: Unchecked
- Primary Server: 2001:4860:4860::8888
- Secondary Server: 2001:4860:4860::8844
-
Apply Changes:
- Click "Apply Changes" to save your configuration changes
-
Navigate to the SSH settings:
- Open your UniFi Controller user interface
- Click on "Settings" in the left sidebar
- Select "Control Plane" from the left menu
- Click on Console
-
Enable SSH access:
- Locate the SSH checkbox
- Check the box to enable SSH access
-
Set up SSH authentication:
- Create a secure password that meets the following requirements:
- At least 8 characters long
- Contains uppercase and lowercase letters
- Includes numbers and special characters
- Enter your chosen password in the password field
- Enter your chosen password again in the confirm password field
- Make note of this password as you will need it for SSH access
- Create a secure password that meets the following requirements:
-
Save your changes:
- Click the Enable button to apply the changes
- The ssh checkbox will be checked when enabled
Now that SSH is enabled, you can connect to your UniFi controller using an SSH client:
- Open your SSH client (PuTTY on Windows or Terminal on macOS/Linux)
-
Connect using the following details:
- Hostname/IP: Your UniFi Controllers IP Address
- Port: 22
- Username: root
- Password: The SSH password you set earlier
- Enter your UniFi Controllers IP in the "Host Name" field
- Ensure port 22 is set
- Click "Open"
- Accept the security alert if this is your first time connecting
- Enter "root" as the username
- Enter your SSH password when prompted
After connecting via SSH, you will need to identify which network interface is being used for your WAN connection.
Run the following command replacing "your.primary.ip.address" with your Google Fiber primary IP address:
ip -o addr show | awk '/your.primary.ip.address/{print $2}'
This command will output your WAN interface name. Example output:
eth0
Make note of the interface name (in this example, eth0) as you will need it for the next steps.
After identifying your network interface, you will need to verify if udhcpc is available on your UniFi controller by running the following two commands:
[ -f '/usr/bin/busybox-legacy/udhcpc' ] && echo 'Available' || echo 'Not Available'
[ -f '/usr/share/ubios-udapi-server/ubios-udhcpc-script' ] && echo 'Available' || echo 'Not Available'
Now that we have verified udhcpc is available, we need to create a CRON job that will run on startup to send DHCP packets.
Use the following command to start editing the CRON file for your controller:
crontab -e
Add a new line to the end of the file with the following cron entry replacing the following variables:
- your_interface_name: Your Interface Name From Step 4
- your.primary.ip.address: Your Primary Google Fiber IP Address
@reboot sleep 60 && /usr/bin/busybox-legacy/udhcpc --foreground --interface your_interface_name --script /usr/share/ubios-udapi-server/ubios-udhcpc-script -r your.primary.ip.address >/var/log/udhcpc.log 2>&1 &
After adding the cron job to your controller be sure to save the file.
- Typing i will allow you to type text into the editor.
- Pressing ESC and typing :wq will save and close the editor.
After adding the cron job, you will need to restart your UniFi controller for the changes to take effect. Use the following command:
reboot
After your UniFi controller has restarted and you've verified everything is working correctly, you should disable SSH access for security:
-
Navigate back to the SSH settings:
- Open your UniFi Controller user interface
- Click on "Settings" in the left sidebar
- Select "Control Plane" from the left menu
- Click on Console
-
Disable SSH access:
- Uncheck the SSH checkbox
- Click Disable to save