Adopting a Ubiquiti USW-Mini via DHCP

The USW Mini is a tiny, 5 port, PoE or USB-C powered switch from Ubiquiti. As part of my homelab reorganization, I picked two up to serve as small spur switches for the downstairs media hub and my office desk. The problem is that, unlike the rest of Ubiquiti’s switching range, these devices are relatively dumb and can be a bit of a pain to get adopted into the Unifi console if you have anything unusual on your network.

In my case, my controller is a pod on my Kubernetes cluster and doesn’t have much of a Layer 2 presence on the network. The USW Mini depends on the L2 features of the controller to enable adoption, but with a little bit of work, you can get them added. The switches support using DHCP to gather their configuration information, but information on how to configure this outside of Ubiquiti’s gateway devices is difficult to find. First of all, they make use of DHCP Option 43, and the value in this option should be an encoded version of your controller’s IP. I use pfSense as my DHCP server, so here is what I did:

  • Go to the Services -> DHCP Server in pfSense
  • On the interface, your switch is on, scroll to the bottom of the page and click to expand Additional BOOTP/DHCP Options
    • In the Option box, put 43
    • Set the Type value to String
    • Convert the IP address of your controller into Hex format
    • Add 01:04 to the *Value field, followed by the Hex IP address, e.g. 01:04:FF:FF:FF:FF
  • Click Save

Now, you can restart your USW-Mini, and it should appear as adoptable in the controller interface.