FW from 16.XX to 20.XX (Auto) Provisioning
Introduction
The beroNet Gateways and Cards can receive their configuration via tftp or http. This method can be used to automatically provision the devices. The basic concept is, that the same configuration files that are provided via the backup function, can be used to provision the device. This gives the user the possibility to configure the device in the way he wants via the GUI and then simply download the backup of this configuration and use it to provision multiple devices at once and automatic.
The provisioning method has evolved throughout the firmware releases:
- Firmware 1 and 2 had http/tftp provisioning which needed to be triggered by using the API
- Firmware Version 3 introduced DHCP auto-provisioning
- Firmware Version 16 introduced a new API, XML - style of backups and single file provisioning
This Document provides a step by step guide on how to provision the beroNet Gateways and Cards.
Prerequirements
In order to provision beroNet devices you will need control over at least a web- or tftp-server. This server provides the configuration files either as plain files or generated via a script. Starting from firmware version 3 you will need control over a DHCP server, only if you want to use auto-provisioning via DHCP.
Provisioning with Firmware from 16.XX to 20.XX
The backup and provisioning uses a single XML file since firmware 16.XX. The structure of this file is explained here: XML Backup & Provisioning File
The first steps to setup a provisioning environment are:
- setup a http/ tftp server
- configure a gateway / card in the way you want it to behave
- download the XXX.config.xml file
- put the XXX.config.xml file on the webserver
- test if you can download the file with a browser
The XXX.config.xml files name contains several information. The structure of the name is:
beroNetVoIPGateway_$SERIALNUMBER$_$DATE_OF_BACKUP$.config.xml
one example is:
beroNetVoIPGateway_3-04-0000016254_2016-09-16T02-43-00-06-00.config.xml
You can rename the file to something more simple, but it is very important that the suffix stays .config.xml, otherwise the provisioning won't work! E.g. you can rename the file to
beronet.config.xml
When the setup is ready and the file can be downloaded via a browser the next step is to inform a gateway about the location of this file. The gateway can receive information about the location via several ways:
- manual configuration via the GUI
- automatic configuration via the API
- automatic configuration via DHCP
Provisioning URL
In any case the location of the configuration file is a URL including the server and the filename. The beroNet devices support special variables that can be used in the URL:
- {MAC} - is replaced by the Ethernet MAC-Address of the device that requests the URL
- {SERIAL} - is replaced by the Serial Number of the device that requests the URL
IMPORTANT: {MAC} and {SERIAL} need to be written in capital letters.
A URL could look like:
http://172.20.5.16/beronet-{MAC}-{SERIAL}.config.xml
Let's assume {MAC} = D8:DF:0D:00:11:22 and {SERIAL} = 1-01-0000000001
In this case the webserver should provide the file:
http://172.20.5.16/beronet-D8DF0D001122-1-01-0000000001.config.xml
This enables the webserver to provide different config files to different devices, even though the same provisioning URL is set in each device.
Provisioning-Config-Update Section in the XML Provisioning file
When you open the XX.config.xml file in an editor you swill see a <update></update> xml block. There are 2 paremeters possible here:
- <update>yes</update> - When the device executes the provisioning, this XML file will be used as new configuration file and it will be imported
- <update>no</update> - When the device executes the provisioning, this XML file will be ignored
Manual configuration via the GUI
This method is very simple, you can manually configure the provisioning URL under Preferences→Provisioning. You need to enable "Manual configuration" and then you need to define If the Provisioning should happen:
- never (off) - does not automatically fetch the config file from above URL on reboot
- once - fetches the config file from above URL only once and then turns off provisioning on boot
- always - fetches the config file from above URL on every boot
You can also specify a Polling interval in minutes
Configuration via the API
The beroNet API is described here: Using the beroNet Gateway & Card API. For Provisioning just a few API commands are required:
- ProvisioningSetConfiguration - sets the Provisioning URL, Mode and interval
- ProvisioningGetConfiguration - displays provisioning-configuration
- ProvisioningTriggerConfig - triggers immediate provisioning
- ProvisioningTriggerFirmware - triggers immediate provisioning of firmware
- ConfigurationActivate - activates configuration-changes
A sample API Call looks like:
http://172.20.5.10/app/api/api.php?apiCommand=ProvisioningSetConfiguration&Mode=once&Url=http://172.20.5.16/beronet-{MAC}-{SERIAL}.config.xml
In this case 172.20.5.10 is the IP of the beroNet Gateway and 172.20.5.16 is the IP of the Provisioning Server.
The API will return:
ProvisioningSetConfiguration:success
if the request has worked. Or an error if e.g. a mandatory parameter is missing:
ProvisioningSetConfiguration:error:invalid_parameters
You can also check via the API if the ProvisioningSetConfiguration command has succeeded:
http://172.20.5.10/app/api/api.php?apiCommand=ProvisioningGetConfiguration ProvisioningGetConfiguration:success:Mode:off;Url:http://172.20.5.16/beronet-{MAC}-{SERIAL}.config.xml;
The following command pipe can be used to provision the device via the API:
- set a provisioning URL for one time configuration updates
- trigger the configuration fetch mechanism
- activates the new configuration without reboot
http://172.20.5.10/app/api/api.php?apiCommand=ProvisioningSetConfiguration&Mode=once&Url=http://172.20.5.16/beronet-{MAC}-{SERIAL}.config.xml ProvisioningSetConfiguration:success http://172.20.5.10/app/api/api.php?apiCommand=ProvisioningTriggerConfig updateConfig:info:config_provisioning_enabled_by_server updateConfig:info:updated:hardware.conf updateConfig:info:updated:isgw.analog updateConfig:info:updated:isgw.cas updateConfig:info:updated:isgw.causes updateConfig:info:updated:isgw.conf updateConfig:info:updated:isgw.cpt updateConfig:info:updated:isgw.dialplan updateConfig:info:updated:isgw.gsm updateConfig:info:updated:isgw.isdn updateConfig:info:updated:isgw.sip updateConfig:info:updated:isgw.tdm updateConfig:info:updated:misc.conf updateConfig:info:updated:network.acl updateConfig:success:config_provisioning:beronet-D8DF0D0035F4-3-04-0000016254.config.xml ProvisioningTriggerConfig:success http://172.20.5.10/app/api/api.php?apiCommand=ConfigurationActivate&Option=1 ConfigurationActivate:success
Automatic configuration via DHCP
The beroNet devices can be provisioned completely automatic via the DHCP server. This is called zerotouch provisioning and works in the following way:
- Default Network configuration is DHCP
- Device requests DHCP settings
- Device receive TFTP Option 66 (or 67)
- Device starts provisioning on the URL provided by option 66 (or 67)
The URL has the same format as in the manual or API configuration, for example:
http://172.20.5.16/beronet-{MAC}-{SERIAL}.config.xml
When using a Windows DHCP Server you can create a static reservation for a beroNet Gateway and set option 67:
With udhcpd option tftp needs to be set:
option tftp http://172.20.5.16/beronet-{MAC}-{SERIAL}.config.xml # Static leases map static_lease D8:DF:0D:00:19:4F 172.20.5.10
When the device boots it will use the URL to fetch its configuration. The device implicitly imports the configuration and activates it as well.
Related pages
If you need scheduled remote assistance, you can request our on-demand support services: https://www.beronet.com/support