Implement Service Provisioning

Implementing Provisioning will be demonstrated by provisioning RADIUS using RADIUS Reply Groups for MikroTik® for a 2M Up/4M Down Service when Open and 56K Up and Down when Suspended.

  1. Determine data specific to the customer service that need to be captured and maintained.
    For RADIUS, three pieces of data are needed: username, password, and plan identifier
  2. Define Resources
    1. Select System Administration > Resources
    2. Select New
    3. Configure the Resource
      For RADIUS enter:
      Table 1.
      Field Value
      Number 1
      Name RADIUS
      Description RADIUS AAA
      Type RADIUS
      Note: Make a note of the Resource number. This number will be needed for editing the service_hook. The Resource number should not be changed in BillMax unless the service_hook is modified as well.
    1. Click Save
  3. Optionally add preconfigured RADIUS attributes for the hardware desired
    For MikroTik® on the command line as the BillMax system user, execute

    load_dictionary.pl -f /usr/local/billmax/freeradius/share/freeradius/dictionary.mikrotik

  4. Create one or more RADIUS Reply Groups
    1. Select System Administration > Attribute Groups
    2. Click the Attribute Group number that needs provisioning or Select New
    3. Add an Attribute Group
    4. Select Add Attribute and add a predefined attribute or add a new one. Repeat for as many attributes as necessary
      Create a 2MB Up/4MB Down Reply Group for an Open Service and a Suspended Reply Group for Suspended Services.
      1. Create the 2MB Up/4MB Down Reply Group and add the following Attribute:
        Attribute Operator Value Type
        Mikrotik-Rate-Limit = 2M/4M reply
      2. Create the Suspended Reply Group and add the following Attribute:
        Attribute Operator Value Type
        Mikrotik-Rate-Limit = 56k reply
    If you execute the SQL SELECT * FROM radgroupreply using Reports > One Time SQL you should see the following

  5. Create or Modify a Product Definition to capture the Provisioning Data
    1. Select Billing Administration > Recurring Service
    2. Click the product definition number that needs provisioning or Select New
    3. Select the Provisioning tab and enter provisioning data
      For RADIUS, create of Service Definition named 2MB Up/4MB Down with the following:
      • Set Provisioning Variable Conflict to Never OK
      • Set Save Plain Text Password to Yes
      • Select the Resources RADIUS check box.
      • Enter the following:
        Table 2.
        Field Value RADIUS Data
        d01 User Name username
        d02 Password password
        d03 Plan plan identifier
      • In addition for d03, enter 2MB Up/4MB Down for Constraint or List ? and 2MB Up/4MB Down entry as the Default.
    4. Select Save
  6. If needed, create a program to transmit the provisioning data to the target system or use an existing program. See Provisioning Executable
    For RADIUS, copy /usr/local/billmax/local/bx_provision_radius.pl-example to /usr/local/billmax/local/bx_provision_radius.pl. Edit the file and set $db, $dbuser and $dbpass to the values needed to access the BillMax database. In addition, set $DISABLEMETHOD to group.
  7. Activate /usr/local/billmax/local/service_hook
    1. Warning: The service_hook runs as the BillMax system user. It can be configured to run under a different id (including root) if needed. The use of non-privileged users is recommended. Please contact support@billmax.com for assistance if a different user id is needed.
      Copy service_hook-example to service_hook in /usr/local/billmax/local and ensure that it is owned and executable by the billmax system user.
    2. Modify the script to call the appropriate system specific provisioning executables
      1. Edit the SERVICES data structure or hash in /usr/local/billmax/local/service_hook. Every Resource must have its own hash set of parameters. Below show the use of /usr/local/billmax/local/bx_provision_radius.pl
        
                                            my $cmd = "$BILLMAXDIR/local/bx_provision_radius.pl";
                                            $SERVICES{1}{name} = "radius";
                                            $SERVICES{1}{provision} = "yes";
                                            $SERVICES{1}{groupswitch} = "-g";
                                            $SERVICES{1}{passwordswitch} = "-p";
                                            $SERVICES{1}{data} = [ "-s", "{NEW_state}", "-n", "{NEW_d01}",
                                            $SERVICES{1}{passwordswitch}, "{NEW_plaintextpass}",
                                            $SERVICES{1}{groupswitch}, "{NEW_d03}" ];
                                            $SERVICES{1}{cmd}{create} = "$cmd -a create “ ."
                                            $SERVICES{1}{passwordswitch} " . escL($ENV{NEW_plaintextpass}) . "
                                            $SERVICES{1}{groupswitch} " . escL($ENV{NEW_d03}) . " " .
                                            escL($ENV{NEW_d01});
                                            $SERVICES{1}{cmd}{delete} = "$cmd -a delete " .
                                            escL($ENV{NEW_d01});
                                            $SERVICES{1}{cmd}{update} = "$cmd -a update";
                                            $SERVICES{1}{remotecmd} = "";
        Note: The $SERVICES{1} above refers Resource # 1. Each of the cmd entries specify how to call the system specific provisioning executable ("$BILLMAXDIR/local/bx_provision_radius.pl) for that action defined. There are three actions: create, delete and update. The create and delete actions are explicitly defined. For updates, the information in the data entry is used to dynamically create the update command arguments. The data entry contains pairs of values that define the update switch and associated value that if changed will trigger a update call. In the above, the remotecmd entry is blank which indicates the command runs on the BillMax host. If populated it is, almost always, the ssh command and any needed arguments. In this way the $cmd executable may be executed locally or on a remote host.
  8. Test the implementation
    1. Go to a test Account within BillMax add a Service based on the Product Definition
      For the RADIUS example add the 2MB Up/4MB Down Service Definition and enter:
      Field Value
      User Name user
      Password p@ssw0Rd
      If you execute the SQL SELECT * FROM radusergroup using Reports > One Time SQL you should see the following:

      SELECT * FROM radcheck WHERE username='user' will result in:

    2. Suspend the Service
      SELECT * FROM radusergroup should not show:

    Important: Whether or not a NAS will honor the changes made to the RADIUS table is dependent on the NAS. The following are possibilities:
    • The NAS will accept a RADIUS COA record and contact RADIUS for new information.
    • The NAS will accept an SNMP request to contact RADIUS for new information.
    • Something else NAS specific.