Prepaid WiFi services

Link copied to clipboard

Prepaid WiFi services enable Internet telephony service providers (ITSP) to offer wireless access services that customers can pay for in advance.

The market for prepaid services includes tourists, immigrant communities, mobile populations such as military personnel, and people with limited credit histories. These users can all gain immediate access to WiFi services at key locations such as hotels, cafes by using prepaid WiFi cards (“vouchers” or “access codes”) purchased at supermarkets and other types of retail outlets. Prepaid WiFi access is a single “purchase” transaction – so at the moment of the authorization all available funds are withdrawn from the account and converted into the WiFi access time.

Typical prepaid WiFi service scenario

Link copied to clipboard

In an ITSP internal network infrastructure, prepaid services are implemented through a debit card application and work in conjunction with the following:

  • Mikrotik RouterBoard 532 with RouterOS 2.9 installed
  • PortaBilling

This combination of services enables a carrier to authorize prepaid WiFi access and debit individual user accounts in real time.

Customer interaction:

Link copied to clipboard
  • Customer selects the WiFi network
  • Customer clicks “Connect”
  • Customer opens web browser
  • Customer opens WiFi gateway authorization page
  • Customer enters the login and password
  • Customer starts working

Setting up your network components

Link copied to clipboard

Mikrotik configuration guidelines

Link copied to clipboard

1. Assign a proper IP address to Mikrotik.

Link copied to clipboard

If it is already assigned go to step 2. If not, set IP address manually or enable DHCP client and assign it to Ethernet interface with the help of winbox.exe utility.

Click the “” button, and select your router; only one should appear.

Select the MiktoTic router

Make sure the login is admin and there is no password. Click Connect.

Connect to the router

Open the IP tab, choose DHCP Client and then at the window click the “+” button. Assign a new DHCP Client port using the Interface drop-down box and click OK.

Select DHCP Client

Add new DHCP Client

Ckeck the client added

2. Connect to Mikrotik.

Link copied to clipboard
ssh admin@
Replace with Mikrotik IP address.

3. Assign IP address to wlan1 interface.

Link copied to clipboard
[admin@Mikrotik] > /ip address add interface=wlan1 address= netmask= disabled=no

[adimn@Mikrotik] > / address print

Flags: X – disabled, I – invalid, D – dynamic

#    ADDRESS            NETWORK         BROADCAST       INTERFACE

 0 D   ether1

 1  wlan1

[admin@MikroTik] >
Network “” is used as a sample.

4. Enable wlan1 interface and set wireless to “access point-bridge” mode.

Link copied to clipboard
[admin@Mikrotik] > /interface enable wlan1

[admin@Mikrotik] > /interface print

Flags: X – disabled, D – dynamic, R - running

#    NAME            TYPE         RX-RATE       TX_RATE      MTU

0 R ether1       ether        0            0          1500

1 R ether2       ether        0            0          1500

2 R ether3       ether        0            0          1500

3 R wlan1        wlan         0            0          1500

[admin@Mikrotik] >

[admin@Mikrotik] > /interface wireless print

Flags: X – disabled, R – running

mtu=1500 mac-address=00:0C:42:05:7A:B6 arp=enabled disable-running-check=no
interface-type=Atheros AR5413 radio‑name="000C42057AB6" mode=station
ssid="MikroTik" area="" frequency-mode=manual-txpower
country=no_country_set antenna-gain=0 frequency=5180 band=5ghz scan-list=default
rate-set=default supported-rates-b=1Mbps,2Mbps,5.5Mbps,11Mbps supported-rates-a/g=6Mbps,9Mbps,12Mbps,18Mbps,24Mbps,36Mbps,48Mbps,54Mbps
basic-rates­-‑b=1Mbps basic-rates-a/g=6Mbps max-station-count=2007 ack-timeout=dynamic
tx-power-mode=default noise-floor-threshold=default periodic-calibration=default
periodic-calibration-interval=60 burst-time=disabled dfs-mode=none antenna-mode=ant-a
wds-mode=disabled wds-default-bridge=none wds-default-cost=100 wds-cost-range=50-150
wds-ignore-ssid=no update-stats-interval=disabled default-authentication=ye
default-forwarding=yes default-ap-tx-limit=0 default-client-tx-limit=0
proprietary-extensions=post-2.9.25 hide-ssid=no security-profile=default
disconnect-timeout=3s on-fail-retry-time=100ms preamble-mode=both compression=no

[admin@Mikrotik] > /interface wireless set 0 mode=”ap-bridge”

[admin@Mikrotik] > /interface wireless print

Flags: X – disabled, R – running


mode=ap-bridge …

[admin@Mikrotik] >

5. Configure DHCP-SERVER for WiFi.

Link copied to clipboard
  1. Add IP pool which will be used for WiFi;
    [admin@Mikrotik] >/ip pool add name=wifi-pool ranges=
    [admin@Mikrotik] >/ip pool print
    #    NAME        RANGE
    0   wifi-pool
    [admin@Mikrotik] >
  2. Add dhcp network;
    [admin@Mikrotik] > /ip dhcp-server network add address= dns-server=, gateway= comment="wifi network"
    [admin@Mikrotik] > /ip dhcp-server network print
    ;;; wifi network
    [admin@Mikrotik] >
    Network «» used for sample, replace it with real network address and set correct dns-server address(es).
  3. Add dhcp server;
    [admin@Mikrotik] > /ip dhcp-server add interface=wlan1 address-pool=wifi-pool lease-time=3d00:00:00 disabled=no
    [admin@Mikrotik] >/ip dhcp-server print
    Flags: X – disabled, I – invalid
    0 dhcp1    wlan1        wifi-pool    3d
    [admin@Mikrotik] >

6. Configure RADIUS client.

Link copied to clipboard
[admin@Mikrotik] > /radius add address= secret="mikrotik" service="hotspot"

[admin@Mikrotik] > /radius print

Flags: X – disabled


0   hotspot                           mikrotik

[admin@Mikrotik] > – IP of Master (Radius) Server, secret – RADIUS Key

7. Configure HOTSPOT server.

Link copied to clipboard
  1. Add profile for RADIUS AAA;
    [admin@Mikrotik] > /ip hotspot profile add name="wi-fi AAA" use-radius=yes
    [admin@Mikrotik] > /ip hotspot profile print
    Flags: * - default
    0 * name="default" hotspot-address= dns-name=""
    html-directory=hotspot rate-limit="" http-proxy= smtp-server=
    http-cookie-lifetime=3d split-user-‑domain=no use-radius=no
    * name="wi-fi AAA" hotspot-address= dns-name=""
    html-directory=hotspot rate-limit="" http-proxy= smtp-server=
    login-by=cookie,http-chap http-cookie-lifetime=3d split-user-domain=no use-radius=yes radius-accounting=yes radius-interim-update=received nas-port-type=wireless-802.11 radius-default-domain="" radius-location-id="" radius-location-name=""
    [admin@Mikrotik] >
  2. Add HOTSPOT server;
    [admin@Mikrotik] > /ip hotspot add name="WiFi" interface=wlan1 address-pool="wifi-pool" profile="wi-fi AAA"
    [admin@Mikrotik] > /ip hotspot print
    Flags: X – disabled, I – invalid, S – HTTPS
    0 X WiFi   wlan1        wifi-pool    wi-fi AAA   5m
    [admin@Mikrotik] > /ip hotspot enable 0
    [admin@Mikrotik] > /ip hotspot print
    Flags: X – disabled, I – invalid, S – HTTPS
    0   WiFi wlan1        wifi-pool    wi-fi AAA   5m
    [admin@Mikrotik] >
    The name of the HOTSPOT server should be WiFi (the same as the special destination for WiFi service in PortaBilling).

8. Connect to WiFi router.

Link copied to clipboard

Select the WiFi network and click Connect.

Choose a wireless network

9. Get online.

Link copied to clipboard
  • Launch your web browser;
  • Enter your MikroTik’s IP address (configured on the step 1) in the browser’s Address field;
  • Enter your Account ID and Service password. Get online

    Browse the details


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.



General configuration

Enable MikroTik Enabled option using the configuration server tool

Enable NetAccess.Enabled option using the configuration server tool

Create a symbolic destination WiFi

Network configuration

Add a node that represents your router in PortaBilling

Configure your WiFi router

Rating configuration (Vendor)

Create a tariff A, which 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 your WiFi product

Create one rating entry in account’s product, using the node you created and tariff B

Account provisioning

Create a retail customer who owns the WiFi cards

Generate a batch of accounts for this customer


MikroTik Configuration

Enable the MikroTik adaptor

Link copied to clipboard
  1. Enable the MikroTik_Enabled option in the GW_Adaptors group on the Configuration server web interface.
  2. Click the Save button and then the Verify button.
  3. Verify the new configuration and click the Check/Apply button.

    Enable the MikroTik adaptor

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 Intrenet access

Create destination

Link copied to clipboard

You need to create the same destination as the name of the HOTSPOT server you specified in step 7 Configure HOTSPOT server. when you set up your network components; in this case it will be WiFi.

  1. On the navigation menu, select Service catalog, select Rate codes, and then select Destinations.


  2. Open the Create a destination panel and fill in the destination information:
    • Format – select Custom from the list.
    • Prefix – type in WiFi.

      Create the destination

  3. Click Save.

Create nodes

Link copied to clipboard

This step is only required if you have not entered your WiFi router into the system before. In this case, you must enter your WiFi routers as nodes. PortaBilling requires some key information about your network equipment such as 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 (that will be used in the select menus).
    • Node ID – Mikrotik server host name (recommended hostname.domainname).
    • IP – IP address of the WiFi router.
    • Manufacturer – select Mikrotik.
    • Type – VoIP node type; select ROUTER.
  3. Click Save.

    Add a node

  4. On the Communication with billing section use the slider to enable Communication with billing option and fill in the node details:
    • Client protocol – select RADIUS from the list to enable the WiFi router (node) to communicate with PortaBilling via RADIUS.
    • RADIUS key – enter the RADIUS secret key you have specified in the configuration of the WiFi router.
    • RADIUS source IP – see the Node ID, NAS IP address, and Radius source IP section of the PortaBilling Administrator Guide. Unless your WiFi router has multiple network interfaces, the value here should be the same as the NAS-IP-Address.
    • POD Server – this option relates to ISP billing. Leave the slider disabled.

      Create nodes

  5. Click Save.
  6. Repeat steps 2-5 until all of your nodes have been entered.

Create a vendor tariff

Link copied to clipboard

The tariff is a single price list for the use of WiFi services. To provide WiFi services successfully, the following tariff should be created:

  • A tariff with data transfer costs; this tariff is created as “Applied to: Vendor.”

To create the required tariff, follow the next steps:

  1. On the navigation menu on the left, select Service catalog and click Tariffs.
  2. On the Create tariff panel, fill in the tariff details:
    • Name – a short name for the tariff object; this is the name you will see in the select menus.
    • Currency – indicates the currency in which the vendor charges you.
      The currency for the tariff may be chosen only once, and cannot be changed later.
    • Service – choose WiFi here.
    • Applied to – choose Vendor in the Applied to list.

      Add the tariff info

  3. Click Save.

Enter rates

Link copied to clipboard

Rates are per-destination prices. Please refer to the Call Billing Parameters section in the PortaBilling Administrator Guide for more information on billing parameters.

Managing rates online

Link copied to clipboard

Create a rate for your WiFi destination.

Enter rates

  1. While on the vendor tariff’s panel (WiFi), click Rates.
  2. On the Add rate panel, fill in the rate details:
  3. Fill in the required information:
    • Destination – specify destination prefix WiFi when billing for WiFi services.
    • First price/Next 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.
  4. Click Save.

Create a vendor

Link copied to clipboard
  1. On the navigation menu, select Infrastructure, then select Vendors.
  2. On the Create vendor panel, fill in the vendor details:
    • Name – type a short name for the vendor object (for example, WiFi Vendor).
    • Currency – leave the base currency.
    • For Opening balance and Billing period fields, leave the default values since this symbolic vendor is created only so that the system functions properly.

      Create a vendor

  3. Click Save.
  4. Repeat steps 2-5 to add all of your vendors.

Define connections

Link copied to clipboard

Connections represent the point from which data leave or enter a network and are directed to or from vendors where charges are incurred.

  1. On your vendor’s panel (WiFi Vendor), click Connections.

    Fill in the connection info

  2. On the Create connection panel, fill in the connection details:
    • Description – type in a short description for this connection.
    • Service type – select WiFi.
    • Tariff – select the vendor tariff you created earlier.
    • Node – choose the Mikrotik WiFi router which you previously added as a node.
    • Capacity – define the capacity value for this connection.
  3. Click Save.
  4. Repeat steps 1-3 to add more connections to the same vendor.

Create a customer tariff

Link copied to clipboard

To successfully provide WiFi services you need to create a tariff for each account’s billing scheme, these tariffs are created as “Applied to: Customer.”

To create the required tariffs, follow the next steps:

  1. On the navigation menu, select Service catalog and click Tariffs.
  2. On the Create tariff panel, fill in the tariff details (please refer to the Create a Vendor Tariff section above for a detailed description of the available tariff attributes):
    • Name – type in a short name for the tariff object; this is the name you will see in the select menus.
    • Currency – select the currency in which you will charge your customers.
      The currency for the tariff is chosen only once, and cannot be changed later.
    • Service – select the service you created earlier (in our example, WiFi).
    • Applied to – select Customer as this tariff will be used to charge your customers.
    • Managed by – select Administrator only here.

      Add a 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 the rate details (please refer to the Enter Rates for Vendor Tariff section above for a detailed description of the available rate attributes). Add rates for the tariff
  3. Click Save.

Create a product

Link copied to clipboard

Account for accessing your prepaid WiFi services will be issued for a specific product. Products are a powerful feature that defines different ways to bill an account. Product definition is always realized through these steps: product definition, service definition and configuration and creation of a rating list.

  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 access to and which actions they can perform.
    • Account role – select Prepaid card.
  3. Click Save.

    Create a product


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 and click Add.

    Add a service

Service configuration

Link copied to clipboard

Define the default values of the service attributes for all the accounts that this product will be assigned to.

  1. Go to the WiFi configuration page and configure the following:
  • WiFi limit bandwidth – use a slider to enable this option.
  • Max download rate – select the measuring unit from the list and specify the maximum allowable download rate value.
  • Max upload rate – select the measuring unit from the list and specify the maximum allowable upload rate value.

    Enable bandwidth limit

Usage charges

Link copied to clipboard

The rating list has two functions: it defines permitted access points (nodes and access numbers) and specifies which tariff should 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 Mikrotik WiFi node.
    •  Access code – leave this field empty.
    • Tariff – select the tariff created previously.
    • Overdraft protection – to configure overdraft protection for this product, consult the Configure Overdraft Protection Section within the Product section in the Overdraft Protection Configuration handbook.

      Add usage charges

  4. Click Save.

Create a customer class

Link copied to clipboard

A customer class provides the ability to define a group of parameters in a centralized manner, and then apply those parameters to many customers simultaneously. Invoicing and payment collection parameters defined by the customer class are not really applicable to this customer. A customer here is merely a placeholder for prepaid WiFi accounts, However, creating a customer class is recommended for defining a proper business model.

  1. On the navigation menu, select Sales, then select Customer classes.


  2. On the Create a customer class panel, fill in the customer class details:
    • Name – type a short name for this customer class.
    • Business model – select which customers this customer class will apply. Select Prepaid Cards Holder from the list
    • Currency – specify in which currency you charge the customers of this customer class. When specified, this customer class can only be assigned to customers with the same currency. Note that you can define the currency only when you create the customer class and can't change it later.
    • Managed by – select Administrator only.

      Create a customer class

  3. Click Save.

Create a customer

Link copied to clipboard

A customer owns their accounts. Therefore, although you will not issue invoices, etc. for the prepaid calling card service, you will still need at least one customer object in order to keep all prepaid card accounts organized in one location.

  1. On the navigation menu, select Sales, then select Customers.
  2. On the Create customer panel, fill in the customer details:
    • Name – enter a short name for the customer object; this will be used on the web interface.
    • Balance control – choose Prepaid from the list.
    • 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 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 Prepaid card holder for this customer.
    • Customer class – choose Prepaid Cards Customers from the list.
    • Billing period – choose a billing period for the customer. A billing period defines the frequency of invoicing for this customer.
    • Billing period time zone – choose a time zone in which customer’s billing period will be closed and invoices will be generated.

      Create a customer

  3. Click Save.

Generate accounts

Link copied to clipboard
Before generating accounts for a production system, read the section on “Provisioning prepaid accounts” in the Prepaid Calling Cards handbook.
  1. On your customer’s panel, click Accounts.
  2. On the Create an account panel, click Account generator.
  3. In the Account generation dialog, fill in information about accounts.

Initial configuration

Link copied to clipboard
  • Account role – the intended usage of accounts. Select Prepaid card from the list.
  • Product – select the main product, which you would like your account to have.
  • Quantity – number of accounts (prepaid cards) to be generated.
  • Batch – accounts are grouped into batches. If Add a new batch is selected, all accounts will be placed into a new batch. Otherwise, an existing batch should be selected from the drop-down list.
  • New batch name – type a name for the new batch.

    Generate accounts

Optional configuration

Link copied to clipboard
  • Opening balance – the initial balance on the card.
  • Requires manual activation – it is normal practice to generate all prepaid cards as inactive so they cannot be misused before being sold to the dealer or end customer. You can always activate the whole batch of cards or an individual card later. If you plan to assign the cards to a distributor later on, the cards must be generated as inactive. Move the slider to the right to generate as inactive.
  • Generation method – the Random method means that every account will be assigned a unique, randomly-generated PIN.
  • ID prefix – if you would like all of the generated accounts to start with the same digit string (e.g., 3804), enter it here. Thus, if you enter 3804 and an ID length of 11, account IDs (PINs) will look like this: 3804NNNNNN, where N = random digits.
  • ID length – all account IDs (PINs) will be numerical and of the specified length. In order to avoid problems with the prepaid card print-shop, PortaBilling will not generate account numbers with a leading zero. Also, PortaBilling will only allow generation of a batch with feasible parameters, e.g., it is impossible to generate a batch of 1,000 accounts with ID length 4 and ID starting at 55.
  • Service password – to improve security, you can use an account password during authentication, in addition to a PIN. If you choose Empty, no password will be assigned to the account, and the password check will be switched off during authentication. Choosing Empty is recommended by default. If you decide to use passwords, then please use the Auto-generated digits only option, since then the password can be entered in the IVR via phone keys.
  • Distributor – you can assign a specific distributor to this group of accounts.
  • Life cycle:
    • Activation date – the date from which the account is usable.
    • Expiration date – the date that the account expires.
    • Availability period after first usage, days – defines the number of days the account remains active after its first use or recharge.
    • Availability period after last usage, days – defines the number of days the account remains active after its last use or recharge.
  • Web self-care:
    • Credentials – if you choose Auto-generated, your customer will use his account ID (PIN) to login to the self-care pages; a random password for web access will be assigned for each account. If you choose Empty, the account owner will not be able to use the self-care pages at all until a login has been assigned for his account; no password will be assigned, so account owners will be able to login to the web interface simply by providing their account ID (PIN).
    • Time zone – when an account owner accesses the web self-care pages to see a list of his calls, the time will be shown in the time zone most appropriate for him.
    • Web interface language – the language to be used on the account self-care web interface.

      Optional configuration

  1. Click Generate.
Account generation tasks are executed every few minutes, and it may take a while to generate large numbers of accounts.


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.


CSV file with information about the new accounts

tipsIn case the original email message was lost or accidentally deleted, the file containing generated accounts is stored on the PortaBilling web (admin) server in the /porta_var/<Server_IP>/ directory, sub-directory cards.

Verify wireless internet event history for account

Link copied to clipboard

To view the xDR of an account, go to Customers, select the Customer owning the accounts, and click on the Accounts icon.

To view the xDR of an account

tips You can also go to the account self-care page (accessible via the Accounts menu item in the Home popup menu).

Log in with the account’s web access login and password. After that you will be able to see the account’s dashboard interface. On the Billing Information tab, click Transactions.

Log in to the self-care interface

Specify search parameters

Choose the date range for which you want to see a list of wireless internet accesses, and click Show Records. In the results table you will see the charges and other fees, such as maintenance fees or refunds (if any). The report can be also downloaded by clicking the image045  Download.

Browse the transactions info

A session status page

Link copied to clipboard

If a user connects to the Internet via NAS/ASN and is about to be disconnected due to a low balance, the user must be warned about the upcoming disconnection. This warning is often implemented as a redirect to a special page, which is, in our case, a Session Status page.

This feature has already been implemented for the Wimax service. If you want to implement this feature for WiFi service, please contact our Support Team at to learn if your hardware allows configuring this functionality.

The following information is displayed on this page:

  • Current session time
  • Available funds
  • Balance expiration (if present)
  • Volume Discount counter/threshold (if Volume Discount Plan is present)
  • Download/upload status

The above information is periodically refreshed. The end user will be notified of this by being redirected to a session status page when:

  • Available funds are close to zero
  • The Volume Discount counter is close to the Volume Discount threshold
  • The Disconnect time (for time-of-the-day products) is drawing close

On this page

What's new
Admin manuals
UI help
Back to main menu