Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:dpi:dpi_bestpractice:qs_rateplans [2020/08/26 10:43] – lexx26 | en:dpi:dpi_bestpractice:qs_rateplans [2023/08/28 14:52] (current) – removed elena.krasnobryzh | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 3 Quick start: share the channel between subscribers according to their plans ====== | ||
- | {{indexmenu_n> | ||
- | ====== Introduction ====== | ||
- | This manual is a step by step instruction on configuring one of the ways to integrate the VAS Experts DPI with billing in order to support an interaction with subscribers billing plans.\\ | ||
- | **Note:** the manual is suitable for version [[en: | ||
- | ====== Subscriber' | ||
- | We use an option [[en: | ||
- | |||
- | 1. We create the file with protocols' | ||
- | |||
- | First, we make a file protocols.txt | ||
- | < | ||
- | http cs0 | ||
- | https cs0 | ||
- | dns cs0 | ||
- | default cs1 | ||
- | </ | ||
- | Here | ||
- | cs0 - corresponds to priority 0 and class 0 respectively\\ | ||
- | cs1 - to priority 1, class1\\ | ||
- | The classes defined in this way can be used in billing plans descriptions. They allow to set up individual limitations for them. Additionally, | ||
- | |||
- | Second, convert it to dscp format that DPI can read: | ||
- | < | ||
- | cat protocols.txt|lst2dscp / | ||
- | </ | ||
- | |||
- | 2. We create a configuration file that describes subscriber' | ||
- | |||
- | For example: settings for billing plan 10 Mb. The billing name is " | ||
- | |||
- | First, we create a file rate_10M.cfg: | ||
- | < | ||
- | htb_inbound_root=rate 10mbit | ||
- | htb_inbound_class0=rate 1mbit ceil 10mbit | ||
- | htb_inbound_class1=rate 1mbit ceil 10mbit | ||
- | htb_inbound_class2=rate 8bit ceil 10mbit | ||
- | htb_inbound_class3=rate 8bit ceil 10mbit | ||
- | htb_inbound_class4=rate 8bit ceil 10mbit | ||
- | htb_inbound_class5=rate 8bit ceil 10mbit | ||
- | htb_inbound_class6=rate 8bit ceil 10mbit | ||
- | htb_inbound_class7=rate 8bit ceil 10mbit | ||
- | htb_root=rate 10mbit | ||
- | htb_class0=rate 1mbit ceil 10mbit | ||
- | htb_class1=rate 1mbit ceil 10mbit | ||
- | htb_class2=rate 8bit ceil 10mbit | ||
- | htb_class3=rate 8bit ceil 10mbit | ||
- | htb_class4=rate 8bit ceil 10mbit | ||
- | htb_class5=rate 8bit ceil 10mbit | ||
- | htb_class6=rate 8bit ceil 10mbit | ||
- | htb_class7=rate 8bit ceil 10mbit | ||
- | </ | ||
- | Notes: | ||
- | * htb_class2-7 - are not used as they are not defined. The upper limit is indicated for a future just in case they would be defined; | ||
- | * 8 bit - is the minimal bandwidth. 0 is prohibited to use here, this value is reserved. | ||
- | |||
- | 3. We connect subscribers' | ||
- | < | ||
- | udr=1 | ||
- | </ | ||
- | and restart DPI. | ||
- | |||
- | 4. Now we integrate DPI with billing: | ||
- | |||
- | The integration method depends on billing' | ||
- | |||
- | 4а. Billing can control equipment by events: creation of a new subscriber, billing plan change, blocking. | ||
- | |||
- | In this case: we select the equipment controlled by SSH/ | ||
- | < | ||
- | fdpi_ctrl load --policing ${rateplan}.cfg --ip ${ip_address} | ||
- | или | ||
- | fdpi_ctrl load --policing ${rateplan}.cfg --login ${login} | ||
- | </ | ||
- | Here | ||
- | ${rateplan} - is the variable: billing assigns it the subscriber' | ||
- | ${ip_address} - billing assigns here IP address 192.168.0.1 of the subscriber (for subscribers with a fixed IP)\\ | ||
- | ${login} - billing assigns here login name of the subscriber dom1kv2 (for subscribers with dynamic IP, multiple IPs or in case we control by login) | ||
- | |||
- | 4b. Billing can not control equipment by events. | ||
- | |||
- | We configure a scheduled output of data from billing by crontab. The list of subscribers with respective billing plan is saved to files named as billing_plan_name.lst. This list may contain IP or login. Then we start loading of these data into DPI. | ||
- | < | ||
- | fdpi_ctrl load --policing rate_10M.cfg --file rate_10M.lst | ||
- | fdpi_ctrl load --policing rate_20M.cfg --file rate_20M.lst | ||
- | ... | ||
- | or (for all at once) | ||
- | for rateplan in *.cfg; do fdpi_ctrl load --policing " | ||
- | </ | ||
- | |||
- | ==== Subscriber' | ||
- | |||
- | 5. We create a description of the billing plan blocked.cfg for restricted or blocked subscribers. Only cs0 traffic is allowed (check the list in paragraph 1): | ||
- | < | ||
- | htb_inbound_root=rate 10mbit | ||
- | htb_inbound_class0=rate 10mbit ceil 10mbit | ||
- | htb_inbound_class1=rate 8bit ceil 8bit | ||
- | htb_inbound_class2=rate 8bit ceil 8bit | ||
- | htb_inbound_class3=rate 8bit ceil 8bit | ||
- | htb_inbound_class4=rate 8bit ceil 8bit | ||
- | htb_inbound_class5=rate 8bit ceil 8bit | ||
- | htb_inbound_class6=rate 8bit ceil 8bit | ||
- | htb_inbound_class7=rate 8bit ceil 8bit | ||
- | htb_root=rate 10mbit | ||
- | htb_class0=rate 10mbit ceil 10mbit | ||
- | htb_class1=rate 8bit ceil 8bit | ||
- | htb_class2=rate 8bit ceil 8bit | ||
- | htb_class3=rate 8bit ceil 8bit | ||
- | htb_class4=rate 8bit ceil 8bit | ||
- | htb_class5=rate 8bit ceil 8bit | ||
- | htb_class6=rate 8bit ceil 8bit | ||
- | htb_class7=rate 8bit ceil 8bit | ||
- | </ | ||
- | |||
- | 6. Next, we create a list of sites that are available in Captive Portal mode. We can skip this step in case only the own portal pages are available. Please find more details in description of [[en: | ||
- | |||
- | 7. We indicate the name or the address of the Captive Portal in configuration file / | ||
- | < | ||
- | cp_server=192.168.0.1 | ||
- | </ | ||
- | Next, we restart DPI: service fastdpi restart | ||
- | |||
- | 8. To place a subscriber into Captive Portal(( In case the events based control is not supported: we save lists of blocked and unblocked subscribers into files blocked.lst and unblocked.lst)) | ||
- | < | ||
- | fdpi_ctrl load --policing blocked.cfg --ip ${ip_address} | ||
- | fdpi_ctrl load --service 5 --ip ${ip_address} | ||
- | </ | ||
- | |||
- | 9. Here we disactivate Captive Portal and restore his billing plan after receiving his payment: | ||
- | |||
- | < | ||
- | fdpi_ctrl load --policing ${rateplan}.cfg --ip ${ip_address} | ||
- | fdpi_ctrl del --service 5 --ip ${ip_address} | ||
- | </ | ||
- | |||
- | ~~DISCUSSION|Please help us to improve our documentation. Let us know if you found an error or something is unclear.~~ | ||