Unifi Access Point SSH upgrade

I was in the process of upgrading a few Unifi Access Point firmware’s and ran in to a problem where the AP’s would not (re)connect to the Unifi Controller when I initiated the firmware update. It was stuck in the update state without actually updating the firmware. The controller showed them as offline/updating.
It was still able to ping it and it was reachable over SSH.

I needed a way to update the firmware using SSH. I looked up the exact firmware download URL on https://www.ui.com/download/. I connected to the specific AP using SSH (Putty) and was able to perform the update manually by running the following command:

((`which nohup` /usr/bin/syswrapper.sh upgrade http://dl.ui.com/unifi/firmware/U7PG2/ >/dev/null 2>/dev/null)&) ; sleep 1

This command took a few minutes to start running and successfully completed the firmware update. I was able to manage them again in the controller with it’s new firmware.

If the AP is on a low firmware level, it may come back with a error that it could not download the firmware because of a certificate error. In that case you can simply change https:// to http://.

T-Mobile Thuis Fiber with EdgeRouter Lite

The amount of configuration information on T-Mobile Thuis fiber connections with EdgeRouter equiptment is a bit scarce. The configuration looks a lot like the KPN Fiber and Vodafone configuration, but is slightly different.

I have chosen to use a fiber to ethernet converter, the TP-Link MC220L. But I think that I will buy the new EdgeRouter 4 when it comes to the Netherlands. Which is roughly the EdgeRouter X with fiber port and the EdgeRouter Lite combined. But for now, this configuration is based on the EdgeRouter Lite 3.

T-Mobile and their VLAN’s

At first, we need to know that T-Mobile seperates the internet and IPTV connection using VLAN’s. VLAN300 is used for the internet traffic and VLAN640 is used for the IPTV traffic. T-Mobile seperates this traffic in their own router. We will have to do the same in our configuration. Later on, we will devide our connection using a bridge in to two seperate VLAN’s. These VLAN’s will be made available in the switches.

My set-up

My set-up is fairly basic. In the diagram below, I have drawn out my setup. Let me talk you through it; The fiber connection comes in at the fiber converter and is attached to the ETH0 interface of the EdgeRouter-Lite (ER-L). The LAN connection is on ETH1 and is connected to an managed ethernet switch. The ETH2 is (in my case) directly attached to the IPTV box.
The switch has (multiple) Ubiquiti UniFi access points attached, a few wired devices (laptop, Ikea Tradfri gateway, a computer) and a (trunk) connection to another managed switch in the living room for my Playstation, TV and HTPC.


The configuration of the EdgeRouter Lite

Below here is a copy of my configuration, with a few details cleared. These are port mappings, static IP assignments and passwords. What this configuration does is the following:

  1. Create ETH0 for the WAN connection, with DHCP enabled so it receives it’s (external) IP from T-Mobile
  2. Split ETH0 in to ETH0.300 for the VLAN300 and ETH0.640 for the VLAN640 traffic (internet and iptv)
  3. Creathe ETH1 with local IP adresses in the range. ETH1 has VLAN300 attached for the internet traffic.
  4. Creathe ETH2 without an IP adres (T-Mobile will handle that itself) with VLAN640 attached for IPTV.
  5. Create a few default firewall rules to block harmful traffic.
  6. Allow NAT for VLAN300 for the internet traffic
  7. Enable an IGMP proxy for IPTV

Read More

Install OpenWRT on the TP-Link TL-WR1043ND and Ziggo in Bridge Mode

I use the internet signal of the (dutch) internet provider Ziggo. Ziggo delivers a standard router, they gave me the Cisco EPC 3925. They also deliver a few other brands like Ubee and other Cisco devices. Ziggo delivers these routers with their own custom firmware and in my opinion, they are not that good. I have experienced a lot of instability issues with wired signal and (very) bad wireless signal.
Because of these issues, and hearing others complain about it too, i started looking in to placing my own router.

I have chosen to use the TP-Link TL-WR1043ND v2, because of the good reviews on Tweakers.net. The default firmware if fairly good, but I wanted some extra features.. So i’ve started to look at custom firmware.

Why OpenWRT?

I have compared a few different types of custom firmware, OpenWRT, DD-WRT and Gargoyle. All three are good, but I have chonen OpenWRT because of the following reasons:

  • Small, clean, configurable. The power of OpenWRT is in their ‘package manager’. In comparing to DD-WRT, OpenWRT gives you only a minimal installation. Other features like VPN needs to be installed using the package manager. This gives you a fast and minimal default installation. Installing new features using the package manager is done by a few simple clicks.
  • Simplicity In my opinion, the default LuCi webinterface looks good and everything is easy to find and configure. With just basic knowledge and common sense, you will be able to configure the standard configuration of your router. Without needing to know how to type in difficult commands in to the command line. The LuCI webinterface is installed by default, and you have the option to install another webinterface if you like.


You will (temporarily) have no internet connection during the installation of OpenWRT. Make sure you have a pc of laptop directly connected with a network cable to your router.

  • (optional) set the Ziggo router to ‘bridge mode. You will have to call the Ziggo support to do that.
  • PuTTY if you are using Windows
  • the right OpenWRT firmware (factory image). Check your TP-Link router if you have the v1 or v2 version. I have the v2.


The installation of the OpenWRT firmware on the TP-Link WR1043ND is fairly easy. Make sure you have downloaded the right factory image. Log in to the webinterface of the TP-Link. In case of the default settings this will probably be Go to System Tools -> Firmware Upgrade. Chose the factory image firmware you have downloaded and start the upgrade. After a few minutes, your router will reboot and OpenWRT will boot up.

That’s it. The basic installation is done. Take your time to go through the webinterface (, configure a good and secure password for the root account, configure the wireless connection to your preferences and have fun!

Extra: Networking statistics

OpenWRT gives you real-time statistics about your network (usage) bij default. But it does not save historical data. I have installed ‘collectd’ to let the router do that. This option saves information about your network usage and uses a really small amount of storage. I have used the following manual: https://advanxer.com/blog/2013/02/openwrt-monitoring-using-collectd/.

1. Update package
opkg update
2. Install luci-app-statistics
opkg install luci-app-statistics
3. List out supported plugins for collectd
opkg list | grep collectd-mod
4. Install desired plugins
opkg install collectd-mod-cpu collectd-mod-interface collectd-mod-memory collectd-mod-ping collectd-mod-rrdtool collectd-mod-wireless
5. Enable init script
/etc/init.d/luci_statistics enable
/etc/init.d/collectd enable