Prepaid WiFi Services

Typical Prepaid WiFi Service Scenario

Setting Up Your Network Components


Create Destination

Create Nodes

Create a Vendor Tariff

Enter Rates

Create Vendors

Define Connections

Create a Customer Tariff

Enter Rates

Create a Product

Create a Customer

Generate Accounts

Verify Wireless Internet Event History for Account

A Session Status Page


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

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:

§         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

Mikrotik Configuration Guidelines

1.     Assign a proper IP address to Mikrotik.

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.



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



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




2.     Connect to Mikrotik.

ssh admin@

NOTE: Replace with Mikrotik IP address:

3.     Assign IP address to wlan1 interface.

[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] >

NOTE: Network “” is used as a sample.

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

[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

name="wlan1" 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 allow-sharedkey=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.

5.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] >


5.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] >


NOTE: Network «» used for sample, replace it with real network address and set correct dns-server address(es).


5.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.

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

[admin@Mikrotik] > /radius print

Flags: X – disabled


0   hotspot                          mikrotik

[admin@Mikrotik] >


NOTE: – IP of Master (Radius) Server, secret – RADIUS Key

7.       Configure HOTSPOT server.

7.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=

    login-by=cookie,http-chap 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] >


7.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] >


NOTE: 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.

Select the WiFi network and click Connect.


9.       Get online.

§         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.




Print the following page and use it 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 must be checked), otherwise the service will not work.






General configuration


Create a symbolic destination WiFi.

[     ]

Enable MikroTik Enabled option using the configuration server tool.

[     ]

Enable NetAccess Enabled option using the configuration server tool.

[     ]

Network configuration


Add node on the web.


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 Wi-Fi 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.

[     ]

Create Destination

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


1.      In the Rating section of Admin-Index, choose Destination.

2.      Click on the  Add button.

3.      Fill in the required information. The country subdivision is optional. You can use the Description column to store some extra information about the destination.



4.      Click  Save.

Create Nodes

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.      In the Networking section of the Admin-Index page, choose Nodes.

2.      In the Node management window, click the  Add icon.

3.      Fill in the New Node form:

o       Node Name – A short descriptive name for this node (that will be used in the select menus).

o       Manufacturer - Select Mikrotik.

o       Type – VoIP node type; select ROUTER.

o       Node ID – Mikrotik server host name (recommended hostname.domainname).

o       NAS-IP-Address – IP address of the WiFi router.

o       Radius Client – Make sure this check box is enabled, since the WiFi router (node) must be able to communicate with PortaBilling®® via RADIUS.

o       Radius Key – Enter the RADIUS secret key you have specified in the configuration of the WiFi router.

o       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.

o       POD Server – This check box relates to ISP billing. Leave it unchecked for now.

4.      Click  Save&Close.

5.      Repeat steps 2-4 until all of your nodes have been entered.

Create a Vendor Tariff

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

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


To create the required tariff, follow the next steps:




1.      In the Rating section of Admin-Index, choose Tariffs.

2.      On the Tariff Management page, choose  Add.

3.      Fill in the Add Tariff form:

o       Name - A short name for the tariff object; this is the name you will see in the select menus.

o       Currency – Indicates the currency in which the vendor charges you.

NOTE: The currency for the tariff may be chosen only once, and cannot be changed later.

o       Applied To – Choose Vendor in the Applied To select menu.

o       Routing – Clear the Routing check box.

o       Service – Choose Wi-Fi here.

4.      Click  Save.

Enter Rates

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

Create a rate for your WiFi destination.





1.      On the Tariff Management page you will see a list of available tariffs. Click the  Rates icon before the name of the tariff.

2.      In the Edit Rates screen, click  Add.

3.      Fill in the required information:

o       Destination – Specify destination prefix WiFi when billing for Wi-Fi services.

o       Interval First – Type in 1 here.

o       Interval Next – Type in 1 here.

o       Price First – Type in zero here as your internet provider doesn’t charge you based on session time.

o       Price Next – Type in zero here as well.

NOTE: 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.

o       Rate Formula Wizard   – launches the wizard for creating a custom rating formula

o       Payback Rate, Hidden, Forbidden or Discontinued flags are optional.

4.      Click the  Save button in the toolbar, or the  icon on the left side of the row.

Create Vendors

1.      In the Participants section of the Admin interface, choose Vendors.

2.      On the Vendor Management page, click  Add.





3.      Fill in the Add Vendor form. Please note that there are three tabs available on the screen. The most important fields are:

Main form (top)

o       Vendor Name – a short name for the Vendor object; this will be used on the web interface.

o       Currency – the currency in which this vendor charges you.

o       Opening balance – starting balance for the vendor; the default is zero.

Additional Info

o       Billing period – split period for vendor statistics.

Web Self-care

o       Time zone – the time zone that the vendor uses for his billing period. Statistics will be split into periods in this time zone, so your statistics will match the vendor’s.


4.      Click  Save&Close.

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

Define Connections

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

1.      In the Participants section of the admin interface, choose Vendors.

2.      Click on the Connections icon next to the vendor name.






3.      Press  Add to add a new connection.

4.      Fill in the connection information. In the Service Type drop-down box, select Wi-Fi. In the Node drop-down box, choose the Mikrotik WiFi router which you previously added as a node. Choose the tariff that defines your data transfer costs for this connection / vendor. Specify Description and Capacity as they are mandatory for all connection types.

5.      Click  Save.

6.      Repeat steps 3-5 to add more connections to the same vendor, then click  Close in order to exit to the Vendor Management screen.

7.      Repeat steps 2-6 to add connections for other vendors.

Create a Customer Tariff

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 tariff, follow the next steps:





1.      In the Rating section of Admin-Index, choose Tariffs.

2.      On the Tariff Management page, choose  Add.

3.      Fill in the New Tariff form (please refer to the Create a Vendor Tariff section above for a detailed description of the available tariff attributes). In the Applied To select menu, choose “Customer”, as this tariff will be used to charge your WiFi customers. Then choose “Administrator Only” in the Managed By select menu (this option is only visible after you select Applied To: Customer above). In the Service select menu, choose Wi-Fi.

4.      Click  Save.

Enter Rates




1.      While on the Edit Tariff page, click on  Rates in the toolbar.

2.      In the Edit Rates screen, click  Add.

3.      Fill in the required information (please refer to the Enter Rates for Vendor Tariff section above for a detailed description of the available rate attributes).

4.      Click the  Save button in the toolbar, or the  icon on the left side of the row.

Create a Product

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 done in two steps: product definition and creation of rating list.





In the Rating section of the Admin-Index page, choose Products.

1.      On the Product management page, click the  Add icon.

2.      Fill in the “Add product” form:

o       Product name – product object name.

o       Currency – product currency; only tariffs which have the same currency will be permitted in the rating list.

o       Product Type – Select Main Product here.

o       Managed By – Choose Administrator only here.

General Info tab

o       Breakage – Leftover balance which is considered “useless” (for statistical purposes). Accounts with a balance below breakage will be counted as depleted. This does not affect account authentication or authorization, so the account can still access wireless services if there is enough money left to cover at least the first interval.

o       Account Default ACL – The access level assigned by default to new accounts created with this product. The ACL determines which operations may be performed by accounts on the self-care pages. The default value is “Account self-care” (pre-defined ACL), which allows all possible operations.

o       Default Discount Plan – Leave None as the selected entry, since discount plans are typically used for postpaid services. Please refer to the description of volume-based discounts in the PortaBilling Administrator Guide for more details.

o       Info URL – If you have an external server with a description of product features, enter the URL here (e.g. http://www.myproduct.com). Your customers will be able to go there from their self-care page.

o       Description – your comments about the intended use of this product.

Maintenance Fee tab

The Maintenance Fees functionality has been replaced by the Subscriptions module. Please use subscription plans to apply periodic charges for the WiFi service to your customers.


3.      Click  Save.

4.      Click on the Services and Rating tab to edit this product’s rating list.

Enter Node and Tariff into Product’s Rating List

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.      When the Services and Rating tab is selected, click on the  Add icon.

2.      Fill in the required information:

o       Service – Choose Wi-Fi.

o       Node – Select the MikroTik node.

o       Tariff – Select here “WiFi” tariff created previously.

o       Access Code – Leave the Access Code fieldempty.

3.      Click  Save to save this rating entry.

Create a Customer

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 of the prepaid card accounts organized in one location.



1.      In the Participants section of Admin-Index page, choose Customers.

2.      On the Customer Management page, choose  Add Customer (In this example, we assume that you are creating the customer manually, so choose Manually from the drop-down menu (do not use any of the Quick Form options)).

3.      Fill in the New Customer form. Please note that there are several tabs with extra information available on the screen. The most important fields are:

Main form (top)

o       Customer ID – short name for the customer object; this will be used on the web interface.

o       Currency – the currency in which this customer will be billed.

o       Opening balance – a starting balance for the customer; the default is zero.

o       Type – Choose Retail here.

o       Customer Class – Choose Default, since the invoicing and payment collection parameters defined by the customer class are not really applicable to this customer, who is merely a placeholder for prepaid Wi-Fi accounts.

Address Info tab

o       E-mail – An e-mail address for the distribution of accounting information. After the billing period is over, a list of xDRs and other statistics will be sent to this address.

o       Bcc – Delivery to the specified email address of your account representative a copy of every outgoing email sent to the customer; this may be used for debug and archiving purposes.

Web Self-Care tab

o       Time Zone – The time zone for the customer web self-care interface.

o       Web Interface Language – Language to be used on the customer self-care web interface.

Additional Info tab

o       Send Statistics – Select do not send (this option prevents the delivery of event statistics to this customer via email).

Billing tab

o       Billing Time Zone – Time zone in which customer’s billing period will be closed and invoices will be generated.

o       Billing Period – Frequency of invoice generation. For more details about the different available billing periods, see the PortaBilling Administrator Guide.

o       Last Day of the Period – Read-only field available only during customer creation; shows the last date of the customer’s first billing period.

o       Invoiced on – Read-only field available only during customer creation; shows a date when customer’s invoice will be generated.

Payment Info tab

o       Credit limit – This customer will contain only debit accounts, so you can ignore this field.

o       Balance Warning Threshold – the customer can be notified by email when his balance is dangerously close to the credit limit and service will soon be blocked. Here you can enter the value for such a warning threshold.

Service Configuration tab

Using this tab, you can activate / deactivate various features of the services provided to customers. Note that features are defined per service type (the physical service provided to the user such as Conferencing, Data Service, Voice Calls, Messaging etc.)


This tab provides you with a convenient tool for managing parameters that will remain the same for a whole set of accounts. Instead of trying to configure them for each individual account, you can define them once at the customer level, then specify in the account configuration that the value in the customer’s configuration be used. Should you wish to change this value later, you need only modify it once for the change to be automatically distributed to all accounts.


Please consult the PortaBilling Web Reference Guide for a description of other parameters available here. For now you may leave these with their default values. If you change them later, these changes will automatically affect all accounts created under this Customer.


4.      Click  Save&Close.

Generate Accounts

NOTE: Before generating accounts for a production system, read the section on “Provisioning prepaid accounts” in the PortaSwitch Prepaid Services Handbook.

1.      Go to the Customers screen (the screen which contains a list of customers). It should look like the screenshot below:





2.      Next to the customer name, click on the Account  or  icon (the one in the Accounts column), which will take you to the account management for that customer.

3.      Click on the Account generator.

4.      Fill in the “Account generator” form:

o       Number of accounts – number of accounts to be generated.

o       Opening balance – the initial balance on the card.

Account Info tab

o       Type – Account type; select Debit for prepaid service.

o       Inactive - It is normal practice to generate all your prepaid Wi-Fi cards in an inactive state so they cannot be misused before being sold to a dealer or end customer. You can always activate the whole batch of cards or an individual card later. If you plan to assign cards to a distributor later on, the cards must be generated as inactive.

o       Generation method – Choose Random here; this will assign every account a unique, randomly-generated PIN.

o       ID prefix – If you would like all of the generated accounts to start with the same digit string (e.g. 98), enter it here. Thus, if you enter 98 and an ID length of 10, account IDs (PINs) will look like this: 98NNNNNNNN, where N = random digits.

o       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.

o       Service Password – To improve security, you can use an account password during authentication, in addition to a PIN; this is highly recommended for the WiFi service. If you choose Empty, no password will be assigned to the account, and the password check will be switched off during authentication (so the customer can supply any password).

o       Batch – Accounts are grouped into batches. If a new batch name is provided in the text field, all accounts will be placed into a new batch with the given name. Otherwise, an existing batch should be selected from the drop-down list.


o       Main Product – choose the main product, which you would like your account to have.

Web Self-Care tab

o       Login – If you choose Account ID (default), your customer will use his account ID (PIN) to login to the self-care pages. 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.

o       PasswordAuto-generated means that a random password for web access will be assigned for each account (these passwords will be included in the .CSV file with the account information). Empty means that no password will be assigned, so account owners will be able to login to the web interface simply by providing their account ID (PIN).

o       Time Zone – When an account owner accesses the web self-care pages to see a list of his active sessions, the time will be shown in the time zone most appropriate for him.

o       Web Interface Language – The language to be used on the account self-care web interface.

Additional Info tab

o       E-Commerce Enabled – If checked, this will allow your debit card owners to make online payments via the PortaBilling® web interface. (Leave unchecked.)

o       Discount Plan – Applies a specific discount plan to this group of accounts. (Leave as Product Default).

o       Distributor – You can assign a specific distributor to this group of accounts.

Life Cycle tab

o       Start Using – The date from which the account is usable.

o       Expiration date – Since we are setting up a postpaid service, which should function for a long time, leave this field blank.

o       Life Time – Since we are setting up a postpaid service, which should function for a long time, leave this field blank.

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

Adobe SystemsNotification 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.




Adobe SystemsTip: In case the original email message was lost or accidentally deleted, the file containing generated accounts is stored on the slave PortaBilling® server in the user porta-admin home directory, sub-directory cards.

Verify Wireless Internet Event History for Account

To view the xDR of an account, go to Customers, select the Customer owning the accounts, and click on the Accounts icon; or, alternatively, select Account Info in the Help Desk section of the Admin-Index page.



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


Login with the account’s web access login and password. After that you will be able to see the account’s dashboard interface with functional drop-down menus upper left. On the Statistics menu, click xDR Browser.






Choose the date range for which you want to see a list of wireless internet accesses, and click Show xDRs. 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  Download icon.


A Session Status Page

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 support@portaone.com to learn if your hardware allows to configure 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