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
This combination of services enables a carrier to authorize prepaid WiFi access and debit individual user accounts in real time.
- 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 drop-down box and click OK.
2. Connect to Mikrotik.
3. Assign IP address to wlan1 interface.
[admin@Mikrotik] > /ip address add interface=wlan1 address=192.168.12.1 netmask=255.255.255.0 disabled=no [adimn@Mikrotik] > / address print Flags: X – disabled, I – invalid, D – dynamic # ADDRESS NETWORK BROADCAST INTERFACE 0 D 192.168.0.214/24 192.168.0.0 192.168.0.255 ether1 1 192.168.12.1/24 192.168.12.0 192.168.12.255 wlan1 [admin@MikroTik] >
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 name=”wlan1”... mode=ap-bridge … … [admin@Mikrotik] >
5. Configure DHCP-SERVER for WiFi.
- Add IP pool
which will be used for WiFi;
[admin@Mikrotik] >/ip pool add name=wifi-pool ranges=192.168.12.2-192.168.12.255 [admin@Mikrotik] >/ip pool print # NAME RANGE 0 wifi-pool 192.168.12.2-192.168.12.255 [admin@Mikrotik] >
- Add dhcp
[admin@Mikrotik] > /ip dhcp-server network add address=192.168.12.0/24 dns-server=192.168.0.1,188.8.131.52 gateway=192.168.12.1 comment="wifi network" [admin@Mikrotik] > /ip dhcp-server network print # ADDRESS GATEWAY DNS-SERVER WINS-SERVER DOMAIN ;;; wifi network 192.168.12.0/24 192.168.12.1 192.168.0.1 184.108.40.206 [admin@Mikrotik] >Network «192.168.12.0/24» used for sample, replace it with real network address and set correct dns-server address(es).
- Add dhcp
[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 # NAME INTERFACE RELAY ADDRESS-POOL LEASE-TIM ADD-ARP 0 dhcp1 wlan1 wifi-pool 3d [admin@Mikrotik] >
6. Configure RADIUS client.
[admin@Mikrotik] > /radius add address=220.127.116.11 secret="mikrotik" service="hotspot" [admin@Mikrotik] > /radius print Flags: X – disabled # SERVICE CALLED-ID DOMAIN ADDRESS SECRET 0 hotspot 18.104.22.168 mikrotik [admin@Mikrotik] >
7. Configure HOTSPOT server.
- 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=0.0.0.0 dns-name="" html-directory=hotspot rate-limit="" http-proxy=0.0.0.0:0 smtp-server=0.0.0.0 login-by=cookie,http-chap http-cookie-lifetime=3d split-user-‑domain=no use-radius=no * name="wi-fi AAA" hotspot-address=0.0.0.0 dns-name="" html-directory=hotspot rate-limit="" http-proxy=0.0.0.0:0 smtp-server=0.0.0.0 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] >
- Add HOTSPOT
[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 # NAME INTERFACE ADDRESS-POOL PROFILE IDLE-TIMEOUT 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 # NAME INTERFACE ADDRESS-POOL PROFILE IDLE-TIMEOUT 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.
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.
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.
Enable MikroTik Enabled option using the configuration server tool
Enable NetAccess.Enabled option using the configuration server tool
Create a symbolic destination WiFi
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
Create a retail customer who owns the WiFi cards
Generate a batch of accounts for this customer
Enable the MikroTik adaptor
- Enable the MikroTik_Enabled option in the GW_Adaptors group on the Configuration server web interface.
- Click the Save button and then the Verify button.
- Verify the new configuration and click the Check/Apply button.
Enable the NetAccess service type
Enable the NetAccess service on the configuration server web interface:
- In the Configuration Tree, click on the BillingEngine node.
- On the Groups panel, select the NetAccess group.
- For the Enabled option, select Yes.
- Click Save and then click Verify.
- Verify the new configuration and click Check/Apply.
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.
- On the navigation menu, select Service catalog, select Rate codes, and then select Destinations.
- Open the Create a destination panel and fill in the destination information:
- Click Save.
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.
- On the navigation menu select Infrastructure. Go to the Billing data sources link and click Nodes.
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.
- Click Save.
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.
- Click Save.
- Repeat steps 2-5 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:
- A tariff with data transfer costs; this tariff is created as “Applied to: Vendor.”
To create the required tariff, follow the next steps:
- On the navigation menu on the left, select Service catalog and click Tariffs.
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.
– 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.
- Click Save.
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.
- While on the vendor tariff’s panel (WiFi), click Rates.
- On the Add rate panel, fill in the rate details:
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.
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.
- Click Save.
Create a vendor
- On the navigation menu, select Infrastructure, then select Vendors.
- On the Create vendor panel, fill in the vendor details:
- Click Save.
- Repeat steps 2-5 to add all of your vendors.
Connections represent the point from which data leave or enter a network and are directed to or from vendors where charges are incurred.
- On your vendor’s panel (WiFi Vendor), click Connections.
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.
- Click Save.
- Repeat steps 1-3 to add more connections to the same vendor.
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 tariffs, follow the next steps:
- On the navigation menu, select Service catalog and click Tariffs.
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.
– 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.
- Click Save.
- On the customer tariff’s panel, click Rates.
- 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).
- Click Save.
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 realized through these steps: product definition, service definition and configuration and creation of a rating list.
- On the navigation menu, select Service catalog and click Products.
- 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.
- 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.
- Click Save.
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:
- On your product’s panel, click Services.
- On the Services panel, click Add a service.
- In the Select services to add dialog box, select WiFi and click Add.
Define the default values of the service attributes for all the accounts that this product will be assigned to.
- 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.
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.
- On your product’s panel, click Charges, then click Usage charges.
- On the Usage charges panel, click Add.
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.
- Click Save.
Create a customer class
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.
- On the navigation menu, select Sales, then select Customer classes.
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.
- Click Save.
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 prepaid card accounts organized in one location.
- On the navigation menu, select Sales, then select Customers.
- 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.
- Click Save.
- On your customer’s panel, click Accounts.
- On the Create an account panel, click Account generator.
- In the Account generation dialog, fill in information about accounts.
- 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.
- 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.
- 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.
- 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.
- Click Generate.
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.
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.
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 Download.
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 firstname.lastname@example.org 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