×

UniFi - Modifying the system.cfg File on Devices for Persistent Changes

Overview

Readers will learn how to implement site-wide changes, or make changes specific to an individual device using the config.system_cfg option in the config.properties file on the UniFi Controller. These options modify the system.cfg configuration file on UniFi devices.

NOTES & REQUIREMENTS:
  • Applicable to the latest UniFi Controller release versions. 
  • This article is not applicable to the UniFi Dream Machine models (UDM/UDM-Pro).
  • This article describes advanced configuration options and should only be attempted by advanced users. 
  • It is not in our Support Team's scope to provide assistance with the custom config.system_cfg and other config.properties options. If you are experiencing issues, please remove the custom options from your environment prior to contacting the support team.
  • See the UniFi - Explaining the config.properties File article for more information on creating the config.properties file.
  • Create a backup using the UniFi - How to Create and Restore a Backup help center article and export/save your backup configuration to a separate device before following this article.

Table of Contents

  1. Introduction
  2. Example config.system_cfg Configuration
  3. Related Articles

Introduction

ATTENTION: The steps in this article are not applicable to the UniFi Dream Machine models (UDM/UDM-Pro).

It is possible to implement site-wide changes, or make changes specific to an individual device when creating and modifying the config.properties file. Using the config.system_cfg option, any variable in the device configuration file (system.cfg) can be customized. The config.system_cfg lines are applied just like any other setting in the config.properties file. Once changes are made, a (re)provision needs to be triggered to apply them.

Lines that are added to the config.properties file using config.system_cfg option need to be numbered and incremented by 1, starting from the number 1. Add a period, the line number, the equal sign, and finally the command. For example:

config.system_cfg.1=command1
config.system_cfg.2=command2
config.system_cfg.3=command3
etc.

The above commands will apply to the entire site. To apply changes to an individual device, add an additional period and the MAC address as well (without colons or dashes). Like the site-wide commands, this is then followed by an additional period, the line number, the equal sign, and finally the command. For example:

config.system_cfg.abcd1234abcd.1=command1
config.system_cfg.abcd1234abcd.2=command2
config.system_cfg.abcd1234abcd.3=command3
etc.
ATTENTION:  It is currently only possible to add to the system.cfg file on the device, and not replace or delete existing lines.

Example config.system_cfg Configuration

The example below shows the commands that would be added to the config.properties file to change the ebtables rules. Note that the below lines are the defaults and are only provided as an example:

config.system_cfg.1=ebtables.1.cmd=-t nat -A PREROUTING --in-interface eth2 -d BGA -j DROP
config.system_cfg.2=ebtables.2.cmd=-t nat -A POSTROUTING --out-interface eth2 -d BGA -j DROP
config.system_cfg.3=ebtables.3.cmd=-t nat -A PREROUTING --in-interface eth2 --proto 0x888e -j ACCEPT
config.system_cfg.4=ebtables.4.cmd=-t nat -A PREROUTING --in-interface eth2 --proto 0x886c -j ACCEPT
config.system_cfg.5=ebtables.5.cmd=-t nat -A PREROUTING --in-interface eth2 --proto LENGTH -j ACCEPT
config.system_cfg.6=ebtables.6.cmd=-t nat -A PREROUTING --in-interface eth1 -d BGA -j DROP
config.system_cfg.7=ebtables.7.cmd=-t nat -A POSTROUTING --out-interface eth1 -d BGA -j DROP
config.system_cfg.8=ebtables.8.cmd=-t nat -A PREROUTING --in-interface eth1 --proto 0x888e -j ACCEPT
config.system_cfg.9=ebtables.9.cmd=-t nat -A PREROUTING --in-interface eth1 --proto 0x886c -j ACCEPT
config.system_cfg.10=ebtables.10.cmd=-t nat -A PREROUTING --in-interface eth1 --proto LENGTH -j ACCEPT
config.system_cfg.11=ebtables.11.cmd=-t broute -A BROUTING -i eth2 -p 802_1Q -j DROP
NOTE: The config.system_cfg lines start from the number 1 and are incremented by 1 for each line.

The following example shows how to change the Tx power on a UniFi Access Point (UAP). First make sure to set the Tx power to Custom in the UniFi Controller Web UI:  devices.png  Devices > UAP > Properties > Configuraton > Radios > Transmit Power > Custom

Afterwards, add the following lines to the config.properties file to apply the changes site-wide. For example:

config.system_cfg.1=radio.1.txpower_mode=custom
config.system_cfg.2=radio.1.txpower=6
config.system_cfg.3=radio.2.txpower_mode=custom
config.system_cfg.4=radio.2.txpower=6

For individual devices, add the MAC address value as well using the instructions from the section above. For example:

config.system_cfg.abcd1234abcd.1=radio.1.txpower_mode=custom
config.system_cfg.abcd1234abcd.2=radio.1.txpower=6
config.system_cfg.abcd1234abcd.3=radio.2.txpower_mode=custom
config.system_cfg.abcd1234abcd.4=radio.2.txpower=6
NOTE: The above lines are only used as an example. A minimum Tx power is set for stability reasons. If you set Tx power too low you may introduce instability.

Related Articles

UniFi - Explaining the config.properties File

Was this article helpful?
1 out of 6 found this helpful
Can't find what you're looking for?
Visit our worldwide community of Ubiquiti experts for more answers
Visit the Ubiquiti Community