There's many nice things about this combo, one of them is that you can take the 24V PoE injector from the Unifi and use it to power the ERX (on eth0) and the Unifi (PoE passthrough on eth4.) The PSU gives 24V/0.5A so it's just enough to satisfy both units.
The setup gave me a bit of trouble though. EdgeOS, as the OS on the ERX is called, is very powerful, but also takes a bit of time getting used to. So if you just want a simple SOHO NAT setup, do something like this:
- Feed the ERX power though the PoE injector and connect a computer to the LAN port on said injector. Configure the ethernet port on the computer to use 192.168.1.2/24.
- Open a browser and connect to 192.168.1.1.
- On the Dashboard tab, leave eth0 unchanged, and keep it as your configuration interface.
- Configure eth1 to be your WAN interface, so make that DCHP client. Make sure you get an IP address.
- Configure switch0 to include eth2 and eth4. Give it a suitable private IP, such as 10.0.0.1/16.
- Configure a suitable DHCP server on 10.0.0.1/16. Make sure its DNSs are 18.104.22.168 and 22.214.171.124, and its router is 10.0.0.1.
- Add a Source NAT Rule that has "Use Masquerade" and "All protocols" with outbound interface set to eth1.
- Change your computer over to eth2 and configure its ethernet port to be a DHCP client. Verify you get an address and can access to EdgeOS web interface on 10.0.0.1.
- Verify you can access the internet.
- Plug the UAP into eth4.
- Download the Unifi Controller program for your OS and install it.
- Discover your UAP and configure SSID and WiFi key.
- Connect on WiFi and verify that things work.
- Make sure to change the default password on the ERX, as the very least.
There's loads more you can do from here, but now you're up and running.