Skip to content

Instantly share code, notes, and snippets.

@nathansgreen
Last active May 15, 2020 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathansgreen/3f1d95eba3144c1904f42f015de25d14 to your computer and use it in GitHub Desktop.
Save nathansgreen/3f1d95eba3144c1904f42f015de25d14 to your computer and use it in GitHub Desktop.
UniFi Reserved IP for Access Point using DHCP

Read the last paragraph if you want a simpler solution.

The current (May 2020) controller interface doesn't give you a clear ability to reserve IP addresses for wireless access points. Instead it gives you the option of statically entering all of the information. You can use the customization features of config.gateway.json to do what the GUI does not let you do.

To figure out your network name, you'll probably want to ssh into your USG and then get your shared-network-name by running the following command: mca-ctrl -t dump-cfg. Once you have a network name and its associated subnet, you can enter in the static mapping(s) you desire for your AP's MAC address(es).

A UniFi Controller running on MacOS will store this file at the following location: $HOME/Library/Application Support/UniFi/data/sites/default/. You can find your unifi_base value with help from this article.

The simplest solution is to skip trying to configure your device directly. Copy your AP's main MAC address (not the one used by WiFi clients) and then add that MAC address on the clients page, and remember to check the "Fixed IP" box and enter in your desired address.

{
"service": {
"dhcp-server": {
"shared-network-name": {
"net_MyNet_eth1_192.168.1.0-24": {
"subnet": {
"192.168.1.0/24": {
"static-mapping": {
"74-83-aa-10-20-fff": {
"host-record": "disable",
"ip-address": "192.168.1.3",
"mac-address": "74:83:aa:10:20:ff"
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment