Preconfiguring elevated radios

I found a method (kind of by accident) for preconfiguring UBNT radios before Elevating them, and thought I'd share, in case this is useful to anyone else. It turns out that this is already possible with the current ePMP elevate firmware (I tested it on 3.2.2).

I haven't tested this on XM devices yet (I assume it'll work the same), but I did just test it on a couple of XW radios (PowerBeam M5 and NanoBeam M5), and it appears to work perfectly... of course it's possible that will be issues with this method in some cases, which I haven't run into, so if you brick a bunch of radios, don't blame me ;)

The process is as follows:

1) Elevate an UBNT radio on the bench (you're going to want physical access to it)

2) once it's up and running with the ePMP elevate firmware, configure with all the necessary settings for a generic template that will be able to connect to your network, and save the settings (you could do this for each individual customer, if you have settings like PPPoE that are unique for every customer, but that would be very time consuming and doesn't make sense to me... you could probably also manually edit the config files for each customer, but I don't want to get into that - using a generic template seems simpler to me).

3) downgrade to UBNT firmware through the ePMP web interface (do not use the tftp method to get back to UBNT firmware, as that would erase everything).

4) Use an SCP client to copy the entire "/etc/persistent/mnt" directory from the radio

5) copy the directory "/etc/persistent/mnt" directory that you save from the pre-configured radio to another UBNT radio (you may need to use a UBNT firmware that allows custom scripts for this to work, like 5.6.4 or older... I haven't check that yet).

6) login to the radio you just copied the files to with SSH and run the "save" command

7) Elevate radio

After the upgrade process is complete, it should come up with all of the settings you configured under the ePMP elevate firmware on the first radio. It doesn't appear to matter how the second UBNT radio is configured, it looks like the ePMP firmware won't try to copy any of the settings it normally would if it finds an existing configuration.

8 Likes

I've used this method to pre-configure and elevate a batch of XM cpes today and aside from them being slow devices it works great.

Thanks for figuring this out!

Hi Mathew

I didn't find any information about persistent/mnt directory on UBNT forum.

Do you know why does it exist?

Thank you, Mathew, for sharing this trick.

There is a script that automates the process:

https://github.com/m0sia/elevator

4 Likes

I believe that the persistent/mnt directory is created by the ePMP elevate firmware. It appears to be where the ePMP settings are stored. As far as I know, it would not normally exist on a radio running airos.

Our current script for upgrading relies on the files sitting on a local web server.

mkdir -p /etc/persistent/mnt/config/
cd /etc/persistent/mnt/config/
wget http://sw.gd.tt/elevate/.configured_3.3
wget http://sw.gd.tt/elevate/DA_VERSION
wget http://sw.gd.tt/elevate/passwd
save
cd
wget -O /tmp/fwupdate.bin http://sw.gd.tt/elevate/UBNTXW-ubntxw-squashfs-factory_3.3-RC14.bin
fwupdate.real -m /tmp/fwupdate.bin

The files you are specifically interested in is the .configured_<version> , passwd and I believe DA_VERSION tells the rest of the code where to look for config files. We don't use radius (yet) and copying the SSH host keys seems like a bad idea. The config file is quite simple to edit / update if you open it up in a text editor (I'll be turning this into a python script at some point with some extra checks and balances, just opening up a SSH connection to the SM and pasting this in works well enough for now).

Yeah, /etc/persistent/mnt doesn't exist on a normal UBNT SM hence it is the first thing my script creates.

The same script works for 3.2 as we have a .configured_3.2 and UBNTXW-ubntxw-squashfs-factory_3.2.bin on the server as well. We are testing IPv6 out on the cambium as we have 2 countries that we operate in where we cannot get IPv4 for.

1 Like

@dmcken wrote:

I'll be turning this into a python script at some point with some extra checks and balances,


Hi!

You can use the following script as a baseline for you needs:

https://github.com/m0sia/elevator

It does exactly the same what you do.


@Dmitry Moiseev wrote:

@dmcken wrote:

I'll be turning this into a python script at some point with some extra checks and balances,


Hi!

You can use the following script as a baseline for you needs:

https://github.com/m0sia/elevator

It does exactly the same what you do.


I've seen it, we may have our users start using that version. I had two question though.

The json config file can only specify the options you want set and everything else will be set to defaults? Also we are getting allot of XM lock ups with 3.2, hence we are testing 3.3 release candidates atm. placing the config file at .configured_3.2 would work?

Hi dmcken!

I know that it is not exactly the same, but you can use it as a baseline and modify to meet your requirements.

>The json config file can only specify the options you want set and everything else will be set to defaults?

that is correct

>placing the config file at .configured_3.2 would work?

We fixed lots of XM-related issues in 3.3 so I receommend to use 3.3 istead of 3.2. If you want to use the script with 3.3 firmware, then you have to change the filename to ".configured_3.3"

Just wondering, can anyone explain step by step just how to do this ?  Is this done in the CLI of the UBNT or the ePMP? Or can create a config file and upload it in the web interface?  Not trying to be a bother just want to understand.

We have created a php web page which pulls all required information from our CRM and builds a config for each client, then the config, certs, paswd files etc and a bash script are all uploaded and written to persistent memory and the device then fetches the appropriate firmware and upgrades itself.

One click to select the client, and one click to confirm, then 10-15 minutes later the device is up and running on the new sector.

It's really made the elevate process feasible, well done to Matthew for spotting this. I have to wonder though why Cambium didn't realise they were writing / reading the persistent file system and make it available as an upgrade path 4 months ago when we all started to investigate elevate and requested a method to streamline the process...

Barry

1 Like

@sherwoodj28 wrote:

Just wondering, can anyone explain step by step just how to do this ?  Is this done in the CLI of the UBNT or the ePMP? Or can create a config file and upload it in the web interface?  Not trying to be a bother just want to understand.


Hi,

If using a Windows PC:

  1. Download and install Python 3.6.1 (https://www.python.org/downloads/windows/)
  2. From Windows CMD Shell, in scripts directory(example: C:\Users\chris\AppData\Local\Programs\Python\Python36\Scripts>), enter the following command: pip install -r requirements.txt    <- Need to be connected to the internet so it can download what it needs
  3. Then run the elevator.py script from the command line (agan within the scripts directory): ..\python.exe elevator.py -u usenamehere -p yourpasswordhere -t sm.json -n 3.3 -v IPaddressofdevice (example: ..\python.exe elevator.py -u ubnt -p ubnt -t sm.json -n 3.3 -v 172.16.16.20

Obviously you may want to customise the sm.json file using Notepad++ or the like. Here you can chang ethe SSID, security key, Bridgemode IP etc.

1 Like

Mind sharing the PHP script? 

I have a script that gives a GUI to the Elevator scsript, it uses the same files that we used from:-

https://github.com/m0sia/elevator

The additional script is attached.