Captive portal for WiFi hotspots

Link copied to clipboard

Overview

Link copied to clipboard

A hotspot is a physical location where people may connect their phones, laptops and other devices over WiFi to access the Internet either for free or for a fee. Before they access the service, users land at the captive portal where they subscribe and/or login, accept the terms of use and can then select their service access options.

PortaBilling contains a captive portal for WiFi hotspot services. This enables you to configure WiFi access points in public places like cafes, libraries, airports, etc. plus generate revenue by selling WiFi vouchers to prepaid users.

The supplied captive portal interoperates only with Huawei BNG (Broadband Network Gateway) and is a sample model. It consists of a front-end web application and a back-end signup module that are both customizable. Your in-house or outsource developers can extend it to interoperate with other WiFi routers and access points that you use. Or, they can use it as the base when building your customized captive portal.

image006

This chapter demonstrates how to configure PortaBilling to provide WiFi hotspot services to prepaid users via WiFi vouchers.

The BNG configuration is outside the scope of the present document, so please follow the Huawei configuration guidelines to configure BNG and provision the following information about the billing server to it:

  • The server’s IP address;
  • The authentication key for RADIUS communication;
  • The authentication key for communication with the signup module via the Huawei portal protocol V2.0;
  • The port for sending authorization requests (1812 by default);
  • The port for sending accounting requests (1813 by default);
  • The URL of the captive portal (by default, accessible at https://<your_web_server_IP>:443/captive_portal).

Scenario

Link copied to clipboard

Let’s say you provide WiFi hotspot services via a captive portal. To access the service, users must accept the terms of use and log in. New users sign up to the service by entering their name, email, gender and phone number. Upon signup, they are provided credentials for subsequent logins.

Your WiFi access options include the following:

  • 30 minutes free per day;
  • $10 vouchers for 1 hr. and
  • $15 vouchers for 2 hrs.

Once the user is authorized for the service, they see their session status and their remaining time.

Checklist

Link copied to clipboard

Use this checklist to check off the operations you have completed while performing the system setup according to the instructions in this chapter. Please be sure to perform all of the operations in the order designated (all of the boxes should be checked), otherwise, the service will not work.

Operation

Done

General configuration

Enable the NETACCESS service on the Configuration server

Create a symbolic destination WiFi

Network configuration

Add Huawei BNG as a node

Rating configuration (Vendor)

Create a tariff A that describes your data transfer costs

Insert rates in tariff A for a symbolic WiFi destination

Create a vendor

Create a connection for this vendor with the WiFi service type using tariff A

Rating configuration (Customer)

Create a tariff B, which will be applied to prepaid WiFi users

Insert rates in tariff B for a symbolic WiFi destination

Create a destination group set

Create a destination group under the destination group

Assign the WiFi prefix to this destination group

Create a volume discount plan A that provides a daily quota of free minutes

Define a daily quota within the volume discount plan A

Create a volume discount plan B that provides prepaid service usage options

Configure a service wallet within the volume discount plan B and define its top-up options

Create a main product for WiFi access

Create one rating entry in this product, using the node you created and tariff B

Associate volume discount plan A with this product

Create an add-on product for WiFi access and allow it to be used with the main product

Associate volume discount plan B with this add-on product

Create a main product with the Voucher account role. It will only be used for generating WiFi vouchers

Account provisioning

Create a customer who owns WiFi vouchers

Generate batches of WiFi vouchers for this customer. The voucher opening balance must coincide with your service wallet top-up options

Captive portal configuration

Create a user with Root permissions that will be used to create accounts for users during signup

Configure the captive portal on the Configuration server

Testing

Open the captive portal page, sign up and establish a WiFi session

Enable the NetAccess service type

Link copied to clipboard

Enable the NetAccess Service on the configuration server web interface:

  1. In the Configuration Tree, click on the BillingEngine node.
  2. On the Groups panel, select the NetAccess group.
  3. For the Enabled option, select Yes.
  4. Click Save and then click Verify.
  5. Verify the new configuration and click Check/Apply.Enable the NetAccess service type

Add a destination

Link copied to clipboard
  1. From the navigation tree on the left, select Service catalog, then Rate codes and click Destinations.
  2. Switch to the Create a destination panel and fill in the new destination details:
  • Format – select Custom.
  • Prefix – type in WiFi.
  • Description – provide some descriptive information about this destination.

    Add a destination

  • Click Save.

Add a node

Link copied to clipboard

This step is only required if you have not entered your BNG into the system before.

A BNG is a trusted gateway and must therefore be entered as a node in PortaBilling. PortaBilling requires some key information about your network equipment such as an IP address, Node ID, RADIUS shared secret, etc.

  1. On the navigation menu, select Infrastructure. Go to the Billing data sources link and click Nodes.
  2. On the Create node panel, fill in the node details:
    • Name – a short descriptive name for this node (e.g., Huawei BNG).
    • Node ID – the BNG host name (recommended hostname.domainname).
    • IP – the IP address of the node.
    • Manufacturer – select Huawei.
    • Type – select BRAS.
  3. Click Save.

    Add a node

  4. On the Communication with billing section use the slider to enable the Communication with billing option and fill in the node details:
    • Client protocol – select RADIUS to enable the BRAS (node) to communicate with PortaBilling via RADIUS.
    • RADIUS key – enter the RADIUS secret key you specified in the BNG configuration.
    • RADIUS source IP – see the Node ID, IP and Radius source IP section of the PortaBilling Administrator Guide. Unless your node has multiple network interfaces, the value here will be the same as for the IP.

      image010

  5. Click Save.

Create a WiFi vendor

Link copied to clipboard

Follow the Create a vendor tariff, Enter rates, Create a vendor and Define connections steps from the Prepaid WiFi services handbook to add a vendor for WiFi services in PortaBilling.

Create a customer tariff

Link copied to clipboard

To provide WiFi access services to customers, create a tariff, which will be applied to WiFi users.

Follows these steps:

  1. On the navigation menu, select Service catalog and click Tariffs.
  2. On the Create tariff panel, fill in the tariff details:
    • Name – type in a short name for the tariff object; this is the name you’ll see in the select menus.
    • Currency – select the currency in which you will charge your customers.
      The currency for the tariff is only chosen once and cannot be changed later.
    • Service – select the WiFi service.
    • Applied to – select Customer.
    • Managed by – select Administrator only here.

      Create a customer tariff

  3. Click Save.

Enter rates

Link copied to clipboard
  1. On the customer tariff’s panel, click Rates.
  2. On the Add rate panel, fill in rate details:
    • Destination – type the WiFi destination directly or select it from the list.
    • Rating mode – select Flat rate here.
    • Interval – type in 1 here.
    • Price – type in zero here as your internet provider doesn’t charge you based on session time.
    • Effective from – if you want this rate to take effect sometime in the future, you can either type in a date manually, or use the calendar (click on the DD-MM-YYYY link).
      When using the calendar, you can specify that the date you are entering is in a different time zone than your present one. PortaBilling will then automatically adjust the time.

       

      Add rates

  3. Click Save.

Create a destination group set

Link copied to clipboard

At this stage you must create a destination group set to use for your volume discount plan configuration.

  1. On the navigation menu on the left, select Service catalog, Rate codes and click Destination group sets.
  2. On the Create destination group sets panel, fill in the required information:
    • Name – type in a descriptive name for the destination group set (e.g., WiFi access);
    • Type – leave the default type Regular.

      Create a destination group set

  3. Click the Save button to save the destination group set.

Create a destination group

Link copied to clipboard

Now you need to create one destination group.

  1. After saving a destination group set, the Destination group page opens.
  2. On the Create destination group panel, type in the destination group name and provide a short description.

    Create a destination group

  3. Click the Save button to save the destination group.

Assign destinations

Link copied to clipboard
  1. On the Destination group page, click the default All destinations group.
  2. On the Search filters panel select Custom from the Format list, type in WiFi to find the desired destination and click Apply filters.
  3. On the Destination list panel select the WiFi prefix and click Assign to group.

    Assign destinations

    Assign destinations

  4. Select the destination group (WiFi in our example) and click Assign.

    Assign destinations

  5. Click Save.

Create a volume discount plan

Link copied to clipboard

A volume discount plan contains all quotas and/or service wallets that you provide your customers. At this stage, you need to create two volume discount plans: one to provide free quota and another to provide prepaid access options.

  1. On the navigation menu on the left, select Service catalog, then Bundles and click Volume discount plans.
  2. On the Create discount plan panel, fill in the volume discount plan details.
    • Name – a short descriptive name for this volume discount plan.
    • Currency – select the currency you use to charge your customers.
      The currency for the volume discount plan may only be chosen once (at creation) and cannot be changed later.
    • Apply discounts to – leave the default value Individual combinations of Services/Destination Group here.
    • Destination group set – choose the destination group set you created in the previous steps.
    • Destination group lookup type – select Same destination as rate here.
    • Managed by – leave the default Administrator only value here.
    • Description – specify an extended discount description.

      Create a volume discount plan

  3. Click Save.

Define a quota within the volume discount plan

Link copied to clipboard
  1. While on the Edit discount plan panel, click the VDP configuration link.
  2. On the Create volume discount group panel fill in the following information:
    • Type – select Quota.
    • Service – select WiFi here.
    • Volume measured – select Service used, minute.
    • Destination group – select the destination group from the list that this discount will apply to.
    • Reset threshold counters select Daily.

      Define a quota

  3. Click Save. The Quota panel opens.
  4. Click Thresholds and specify 30 for the Peak period threshold.

    Configure thresholds

  5. Switch to the Notifications panel and specify when a user receives a notification that the quota expires (e.g., 5 minutes before quota expiration).
  6. Click Save to save your changes.

Configure a service wallet

Link copied to clipboard

Paid service access options are available for users within a service wallet.

  1. Repeat the Create a volume discount plan step and create a volume discount plan to store the service wallet in.

    Configure a service wallet

  2. On the Create volume discount group panel fill in the following information:
    • Type – select Service wallet.
    • Service – select WiFi here.
    • Volume measured – select Service used, minute.
    • Destination group – select the destination group from the list that this discount will apply to.

      Configure a service wallet

  3. Click Save. The Service wallet panel opens.
  4. Click Top-up configurations and define top-up options (in our example, for 60 and 120 minutes).

    Configure a service wallet

  5. Click Save.

Create a main product

Link copied to clipboard

To access your services, accounts will be created for your users and assigned specific products. Products are a powerful tool to define different ways to bill an account. Product definition is always realized through these steps: product definition, service definition and configuration and then the rating list is created.

  1. On the navigation menu, select Service catalog and click Products.
  2. On the Create product panel, fill in the product details:
    • Name – type in a short name for the product object; this is the name you will then see in the select menus.
    • Name visible to end users – Specify the name of this product that your customers will see on their self-care interface.
    • Product type – select Main product here.
    • Currency – choose a currency the product will be priced in.
    • Managed by – select Administrator only here, since we are setting up a service without the involvement of resellers.
    • Account default ACL – choose an Access Control List (ACL) for accounts with this product assigned. ACLs control which objects end users can gain access to and which actions they can perform.
    • Account role – select Universal from the list.
  3. Click Save.

    Create a product

Included services

Link copied to clipboard

Define which service types are included in the product. A service type is a description of the physical service provided to end users.

To add a service type:

  1. On your product’s panel, click Services.
  2. On the Services panel, click Add a service.
  3. In the Select services to add dialog box, select WiFi access and click Add.

    Add a service

  4. Click the WiFi link to limit WiFi bandwidth. Specify maximum upload/download speed.

    Specify maximum upload / download speed.

Usage charges

Link copied to clipboard

The rating list has two functions: it defines the access points permitted (nodes and access numbers) and specifies which tariff must be used for billing in each of these points.

  1. On your product’s panel, click Charges, then click Usage charges.
  2. On the Usage charges panel, click Add.
  3. Fill in the required information:
    • Service – select WiFi.
    • Node – select the Huawei BRAS node.
    • Access code – leave this field empty for the basic SIP service.
    • Tariff – select the WiFi tariff you created before.
  4. Click Save.

    Configure usage charges

  5. Click General info and associate the volume discount plan with the free quota with this product.

    Select default discount plan

  6. Click Save to save the changes.
  7. Repeat steps 1-4 and create another main product with the Voucher account role. This product is only required to generate vouchers. Therefore, you can use the same tariff you created in previous steps for definitions of usage charges.

    Create a product with voucher account role

Create an add-on product

Link copied to clipboard
  1. Click the image033 arrow icon to return to the Products panel.
  2. On the Create product panel, fill in the product details:
    • Name – type in a short name for the product object; this is the name you will then see in the select menus.
    • Name visible to end users – specify the name of this product that your customers will see on their self-care interface.
    • Product type – select Add-on product here.
    • Priority – specify the product’s priority.
    • Currency – choose the currency the product will be priced in.
    • Managed by – select Administrator only here, since we are setting up a service without the involvement of resellers.
    • Account default ACL – choose an Access Control List (ACL) for accounts with this product assigned. ACLs control which objects end users can gain access to and which actions they can perform.
    • Account role – select Universal from the list.

      Create an add-on product

  3. Click Save.
  4. On the product panel that opens, click Charges, then General info and select the volume discount plan with the service wallet from the Default discount plan list.

    Create an add-on product

  5. Switch to the Additional information panel.
  6. Click the Add product button in the Add-on product is allowed with section and select the main product you just created.

    Select allowed products

  7. Click OK.
  8. Click Save to save the changes.

Create a customer

Link copied to clipboard

In this case, the customer record is used to store vouchers and accounts to be created for your WiFi users.

  1. On the navigation menu, select Sales, then select Customers.
  2. On the Create customer panel, fill in the customer details:
    • Name – type a short name for the customer object; this will be used on the web interface.
    • Balance control – specify the way the customer will pay for the service. Select Prepaid in this field.
    • Currency – choose the currency in which this customer will be billed.
    • Available funds – since this customer is used as a placeholder for storing accounts, the number amount of available funds is insignificant. Type zero here.
    • Business model – a business model defines what type of service is to be provided to the customer. Select Universal for this customer.
    • Customer class – customer class allows you to define a policy for automated payment collection. Since you will not issue invoices nor collect payments for this customer, leave the Default customer class here.
    • Billing period – choose a billing period for the customer. A billing period defines the frequency of invoicing for this customer. Leave the default monthly value here.
    • Billing period time zone – choose a time zone where customer’s billing period will be closed and invoices will be generated.

      Create a customer

  3. Click Save.

Generate vouchers

Link copied to clipboard

Vouchers grant users access to your paid access options. To differentiate between WiFi access options, generate vouchers in separate batches according to the top-up options you defined for your service wallet. Give descriptive names to these batches to keep your vouchers well organized (Examples of batch names: “$10 for 60 minutes”). The voucher opening balance must be the same as the fee value you defined within the service wallet top-up options.

For more information about batch management, please read the Provisioning Prepaid Accounts section.

In our example, we will generate two batches for vouchers, one for 60-minute access and another for 120-minute access. The voucher opening balances are $15 and $20, respectively.

  1. On the customer panel that opens, click Accounts.
  2. Switch to the Create account panel and click Account generator.
  3. Specify the account generation parameters:
    • Account role – select Voucher.
    • Product – select the main product you created for voucher generation.
    • Quantity – define the number of vouchers to generate.
    • Batch – specify the batch name.

      Generate vouchers

    • Switch to the Optional configuration tab and define the Opening balance value (e.g., 10).
    • Requires manual activation – leave this option disabled to generate vouchers with the active status.
    • Service password – select Empty from the list.
    • Life cycle – specify the activation/expiration dates for the vouchers using the calendar. By default, vouchers are active for 90 days after their activation date.

      image039

    • Click Generate.
      Account generation tasks are executed every few minutes, so it may take a while to generate large numbers of accounts.
  4. Repeat step 3 and generate another batch of vouchers for 120 minutes of WiFi access. Specify $15 as the opening balance.
Notification about the generated cards will be sent by email to the user who created them. A CSV file with information about the new accounts will be attached.

Create a root user

Link copied to clipboard

When a user registers for the service, the signup module creates an account for the user in PortaBilling via the API. To make this happen, you must provide the API access to the PortaBilling web server by creating the user with root permissions.

  1. From the navigation tree, select My company, Access control and then Users.
  2. On the Create user panel, fill in the new user details:
    • Login – specify the login for this user.
    • Password – specify the password for this user.
    • Email – type in your email to receive the user credentials upon creation.
    • Role – define the access role for this user. Select Root from the list.

      Create a root user

  3. Click Save. The User panel opens.
  4. Select Web self-care panel and enable the API token access option. The API token is now generated.

    Configure the web self-care

  5. Click Save.

Configure the captive portal on the Configuration server

Link copied to clipboard
  1. On the Configuration server web interface, clone the currently active configuration to modify it.
  2. From the Configuration tree, select ClusterSuite -> WebCluster.
  3. Select the CaptivePortal group and configure these options:
    • enabled – set Yes.
    • nasHost – specify the IP address of your BNG.
    • nasPort – specify the port on your BNG (the default one is 2000).
    • nasSecret – specify the authentication key for communication with PortaBilling via Huawei portal protocol V2.0. It must be the same as the one you defined during the BNG configuration.
    • pbAdminLogin – specify the login of the user you created for the API access to PortaBilling.
    • pbAdminToken – specify the API token generated for the user.
    • pbProductId – specify the internal ID of the main product (i_product) you created for WiFi access (WiFi signup in this example).
    • pbAddonId – specify the internal ID of the add-on product (i_product)  you created in the previous step (Paid options in this example).
    • pbCustomerId – specify the internal ID of the WiFi card owner (i_customer).
    • uiCompanyName – define your company name. Users will see it on the captive portal page.
    • uiConditionsInfo – specify your terms of use here.

      Configure the captive portal on the Configuration server

      tips TIP: To find the internal ID of the customer and products, connect to PortaBilling via the API and call these API methods:

      To find the ID of the main product:

      -curl https://<your_web_server>/rest/Product/get_product_list 
      
      -d auth_info='{"session_id":"session_ID"}' 
      
      -d params='{"name":"WiFi signup"}'

      To find the ID of the add-on product:

      -curl https://<your_web_server>/rest/Product/get_product_list 
      
      -d auth_info='{"session_id":"session_ID"}' 
      
      -d params='{"name":"WiFi access options""}'

      To find the ID of the customer:

      curl https:// <your_web_server>/rest/Product/get_product_list 
      
      -d auth_info='{"session_id":"<session_ID>"}' 
      
      -d params='{"name":"WiFi access options"}'

      Alternatively, you can find the internal ID number via the web interface: they are the last digits in the URL when you open a record.

  4. Click Verify to verify the configuration.
  5. Click Check/Apply to apply the configuration.
    Note that the Apache service will need to be restarted, therefore apply the configuration during off-peak times.

Testing

Link copied to clipboard
  1. Connect to WiFi from your device.
  2. You are redirected to the captive portal page.
  3. Accept the terms of use.

    image047

  4. Enter your information for signup and click Sign Up.

    image049

  5. Your WiFi access credentials are returned. Store them somewhere so you can log in later and then click Close.

    image051

  6. Select the Use PIN option and enter a voucher PIN.

    image053

  7. Click Submit.
  8. You are now connected to WiFi and can see your remaining time.

    image055

On this page

Release
What's new
Admin manuals
Handbooks
Developers documentation
UI help