Tag Archives: usg

NBN Unifi USG 3P PPPOE settings

I just switched my NBN from Telstra to Spintel.

Telstra is using DHCP while Spintel is using PPPOE. But when I configure the usrename and password for my WAN, USG can’t connect to internet.

Spent lots of time to troubleshot this issue, and then I notice that there is a log on USG

Oct 29 14:49:25 USG pppd[8094]: pppd 2.4.4 started by root, uid 0
Oct 29 14:49:25 USG pppd[8094]: Failed to create PPPoE socket: Protocol not supported
Oct 29 14:49:37 USG xl2tpd[8208]: setsockopt recvref[30]: Protocol not available

Then I realize it’s a driver issue. Looks like USG won’t load PPPOE driver without a restart. So if you are using DHCP in the past, after you change to PPPOE, you need to restart your USG.

After restart USG, all good.

Add Cloudflare Dynamic DNS Support on Unifi USG

It seems Unifi USG still doesn’t support Cloudflare Dynamic DNS, even though lots of users voted for this feature.
In the past I’m using dnsomatic to update cloudflare DDNS, but dnsomatic is not working anymore. So I spent sometime to find a solution.

1. Create a config.gateway.json and put it on unifi controller. Then provision USG.
If you don’t know how to create the file, please refer to https://help.ubnt.com/hc/en-us/articles/215458888-UniFi-Advanced-USG-Configuration

{
	"service": {
		"dns": {
			"dynamic": {
				"interface": {
					"<WAN interface eg eth0>": {
						"service": {
							"cloudflare": {
								"host-name": [
									"<insert A record name here eg. usg.example.com>"
								],
								"login": "<CloudFlare E-Mail>",
								"options": [
									"zone=<DNS Zone eg. example.com>"
								],
								"password": "<CloudFlare Global API Key>",
								"protocol": "cloudflare"
							}
						}
					}
				}
			}
		}
	}
}

2. Upgrade ddclient on USG to version 3.9.0.
Save below script as a bash file:

#!/bin/bash
# Run this script as sudo

# Specify the repo and the location of the apt sources list
DEB_REPO="deb http://archive.debian.org/debian/ wheezy main # wheezy #"
APT_SRC="/etc/apt/sources.list"

# Add deb repo to sources list if it isn't there
grep -q -F "$DEB_REPO" "$APT_SRC" || echo "$DEB_REPO" >> "$APT_SRC"

# Run Apt update
apt-get update; apt-get -y install libdata-validate-ip-perl

# Download new ddclient and replace the existing version
cd /tmp
curl -L -O https://raw.githubusercontent.com/ddclient/ddclient/master/ddclient
cp /usr/sbin/ddclient /usr/sbin/ddclient.bkp
cp ddclient /usr/sbin/ddclient
chmod +x /usr/sbin/ddclient

And chomod +x the file and run it with root. Then the script will install libdata-validate-ip-perl as well as ddclient 3.9.0.

3. As we are using standard ddclient, so we have to create a copy of the old ddclient configuration file.

cd /etc/ddclient
cp ddclient_eth0.conf ddclient.conf

4. Then restart ddclient.

/etc/init.d/ddclient

5. Done. From system log, you should be able to see ddclient update cloudflare DDNS now.