I have create a set of scripts to automated the deployment for batch of BR1 mini’s.
Next week I have a batch of 100 units to deploy and I wanted to automate the process.
The scripts are 100% hands off, no chrome browser, or manual login required.
I wrote it in batch scripts as I wanted to be able to use a lot of windows laptops without having to set up the correct environment for it to run. If any one would like to contact me to rewrite in another language we can do so. I was think about redoing it later in perl.
Why I created this script:
The BR1 mini is an excellent priced router, however it lacks out of box capability to connect to ic2 via wan or wwan (wifi as wan). You may not have pre-activated sims, or you may be deploying them in one region and shipping it to another. You may also not want to use cellular data just for the deployment.
I also wanted to be able to change variables during different deployments which makes it impractical to use a config file or the bulk config tool.
Features it provides:
Ping check as it waits for the router.
Looping trying to login to the router.
Automates changing the password as required in new builds.
Activation of the wan trial.
Change priorities of the wan in the dashboard.
(WAN P1, Wifi as Wan P2, Cellular P3)
Set the apns on both sim cards.
Set cellular usage limit with management restriction at 20GB
Set a profile on the Wifi As Wan connection.
I enabled wifi as wan so I didn’t have to plug in a second cable to get it online in incontrol2.
The mini’s ports out of box both the lan and the wan act as lan.
pre-caches firmware files needed from peplink site.
Optionally upgrade the firmware from a local file, assumes you don’t want to send the firmware down 100 times for deployment.
Manages reboot of firmware, and confirm the device comes back up with the new firmware.
I wanted to be able to configure the entire deployment with no internet, or access to incontrol.
Most of my steps are actually pre-configuration which is required to connect to incontrol , however I also added the automation of the firmware upgrade as well.
Optionally confirm Cellullar sim A has connection to the cellular network, and get it’s state and IP address.
Attempts to get the iccid of both cards.
Notifies user when the current router is complete and it’s ready for the next one.
Continues to loop waiting for the next router.
Records serial number, firmware version, Cellular state, Cellular IP, time/date to a csv file for later retrieving.
You can also reset to factory default, and revert firmware:
Log file attached: deployment.txt (2.1 KB)
script attached. remove .pdf it is a zip archive.deploy-mini-scripts.zip.PDF (1.9 MB)
script zip password is pepwave
Extract to a folder, and run the script from the folder.
Script will expect the router to be at the following address https://192.168.50.1:443 with login admin/admin. This is can all be changed at the top of the script.
To speed up the process hard code your ethernet to 192.168.50.x or something other then 192.168.50.1 so you don’t have to wait for the pepwave to give you a dhcp address.
usage:
deploymini STANDARD (Standard deployment include firmware upgrade)
deploymini NOFW (Standard install exiting early without FW upgrade)
deploymini GETSN (Just gets serial number and exits)
deploymini GETFW (Gets FW version and exits)
deploymini GETCELLULAR (Just gets cellular checks status and exits)
deploymini GETCELLULARICCIDONLY (Just gets cellular iccid and exits)
deploymini RESET (This would factory reset leaving current fw)
deploymini RESET-REVERT (This would factory reset and downgrade fw)
deploymini CELLRESET (Reboots only cellular module.)
The scripts were create by using a live deployment in chrome and watching the web posts, then building logic around it.
The scripts do not prevent you from trying to send invalid data so keep in mind if you modify anything that is not pre-defined.
Script will change admin/admin to admin/Script2021!
I’m hoping that this will help others with mass deployments.
These scripts worked well for my deployment however your mileage may very.
I’ll work on creating and uploading a video later, it’s awesome to watch the wan priorities changes from running a script.
Jonathan
[email protected]