Reply
New Member
Posts: 9
Registered: ‎08-24-2015
Solutions: 1
Accepted Solution

Saving config.gateway.json file for USG

HI again

Now I have my config the way I need it (with it working and being happy), I want to save this  config so the Controller doesnt override it when I make a change in the GUI

I have looked at previous instructions (for instance, here) but I cant locate the /sites/<site> directory.

My USG is using software version 4.2.6.4751786

I have attempted to use WinSCP to connect to the USG. I can locate my saved config.gateway.json file in TMP, but not the /sites location.

 

any ideas?

Capture.PNG

Accepted Solutions
Established Member
Posts: 1,556
Registered: ‎07-18-2015
Kudos: 746
Solutions: 121

Re: Saving config.gateway.json file for USG

That directory is on the controller rather than the USG itself. The idea is that the controller still pushes the config to the USG, but the config is that set in the json file.

If pasting output, please use the code tags button ({i})!
Please help the community find useful posts and solutions by hitting the "Kudos" and "Accept as Solution" buttons!

View solution in original post


All Replies
Established Member
Posts: 1,556
Registered: ‎07-18-2015
Kudos: 746
Solutions: 121

Re: Saving config.gateway.json file for USG

That directory is on the controller rather than the USG itself. The idea is that the controller still pushes the config to the USG, but the config is that set in the json file.

If pasting output, please use the code tags button ({i})!
Please help the community find useful posts and solutions by hitting the "Kudos" and "Accept as Solution" buttons!
New Member
Posts: 9
Registered: ‎08-24-2015
Solutions: 1

Re: Saving config.gateway.json file for USG

Aah righto, that makes sense.

I'm guessing it just goes to the path  C:\Users\%username%\Ubiquiti UniFi\data\sites\<site>

The only directory in there is 'Maps' at the moment.

Established Member
Posts: 1,556
Registered: ‎07-18-2015
Kudos: 746
Solutions: 121

Re: Saving config.gateway.json file for USG

Correct, AFAIK there should only be the config files etc. that you created in that folder, except for the maps. The controller takes this file and combines it with what it has configured for the USG and pushes the whole config out.

If pasting output, please use the code tags button ({i})!
Please help the community find useful posts and solutions by hitting the "Kudos" and "Accept as Solution" buttons!
Emerging Member
Posts: 61
Registered: ‎05-14-2015
Kudos: 19

Re: Saving config.gateway.json file for USG

Hi All,

 

Im new to the USG product and had deployed 2 of them with VPN configured via CLI. Ive got issues like after i configured and saved it then i also configured something on the GUI then my settings will disapear on the the cli. I have emailed to support to use config.gateway.json but im not entirely sure how to set it up as am a newbie. Would  you be so kind to provide me a step by step instruction on how to go about it? I have my controllet installed on an Ubuntu server and i can make my way to locate the site but stuck on what do i do next. Looking forward for your reply. Im trying to setup a vpn bytheway.

 

Regards,

Ernie

SuperUser
Posts: 15,007
Registered: ‎08-07-2008
Kudos: 7193
Solutions: 414
Contributions: 1

Re: Saving config.gateway.json file for USG

https://help.ubnt.com/hc/en-us/articles/215458888-UniFi-How-to-further-customize-USG-configuration-w...

 

KB artcal on how to work with the json file. 

Walks in, tells it like it is, walks out , milks a cow
New Member
Posts: 6
Registered: ‎06-30-2016

Re: Saving config.gateway.json file for USG

[ Edited ]

My Unifi controller is on a raspian pi

 

If i am not mistaken the place where to put the config.gateway.json file is on /var/lib/unifi/sites/default/

 

Is that location correct?  I changed the rights to that directory accodingly.

 

So for my understanding you place the config.gateway.json file on the controller after every manually changing config statements on the USG box?  What about when you make adjustments by the controller page?  Do you need to generate the jason file and place it on the controller as well?  

  

Could some one point me in the right direction if you need to copy the json file after every update?

New Member
Posts: 27
Registered: ‎09-28-2016
Kudos: 1
Solutions: 1

Re: Saving config.gateway.json file for USG

I have the cloud key, I SFTP in and found this directory to be:

 

/srv/unifi/data/sites/[SITE CODE}/

 

I placed my .json there, right now I can ping both and have not had a provisioning loop, but I haven't rebooted...time will tell

New Member
Posts: 7
Registered: ‎09-28-2016
Kudos: 1

Re: Saving config.gateway.json file for USG

The KB article you reference does not say how or when the controller pushes config.gateway.json.

 

* Does the controller push the file when it first appears, when it changes, when the controller restarts, on demand by the USG or something else?

 

* How long should I wait for the update to occur?

 

* Will the update be reflected in /config/config.boot?

 

* Can I force the controller to push the file? If so, how?

 

I ask all these questions because I've placed the file into the sites/<site> directory and have not seen any updates on my USG, not before or after a restart. Please provide the algorithm that's at work.

Member
Posts: 136
Registered: ‎11-23-2016
Kudos: 22

Re: Saving config.gateway.json file for USG

From what I understand, you have to force the controller to do a provisioning for your changes to take affect.   The easiest way to do this is to change something like the DHCP pool range, that will force a provisioning.

Member
Posts: 240
Registered: ‎11-28-2016
Kudos: 127
Solutions: 1

Re: Saving config.gateway.json file for USG

 


chaycock wrote:

From what I understand, you have to force the controller to do a provisioning for your changes to take affect.   The easiest way to do this is to change something like the DHCP pool range, that will force a provisioning.


There is a "Force Provision" button on the Config -> Manage Device screen.

New Member
Posts: 1
Registered: ‎04-01-2017

Re: Saving config.gateway.json file for USG

After it provisions, do you delete the config.gateway.json file from the controller?  

Reply