====== Traffic policing management. Named policing profiles ======
{{indexmenu_n>3}}
Policing profiles are created, modified, and deleted using the ''fdpi_ctrl'' utility.
Policing profiles are divided into two types:
* **Anonymous (unnamed) profiles** — the policing profile is not created in advance; its parameters are specified when the service is assigned to a subscriber, either in JSON format or as a policing configuration file
* **Named profiles** — the policing profile is created before being assigned to a subscriber and is stored in the internal DPI database — [[en:dpi:dpi_components:platform:dpi_admin:admin_db|]]
**Named profiles** have the following advantages over anonymous profiles:
- Simplify subscriber administration
- Allow finding subscribers with a required profile by profile name
- Allow updating the profile for all subscribers using a given profile simply by changing the profile parameters
- Allow controlling the limit on the number of unique profiles (maximum 65535)
**Anonymous (unnamed) profiles**, in turn, have the following advantages:
- No profile management is required (there is no need to create or delete profiles); the profile is automatically removed when the subscriber or the subscriber's profile is deleted
- No profile name needs to be invented
===== Command syntax =====
General command format:
fdpi_ctrl command --policing policing_description_file [IP_list] [LOGIN_list]
Command parameter description:
^ Parameter ^ Description, possible values, and format ^ Note ^
| ''command'' | Values:\\ 1. ''load'' — load data\\ 2. ''del'' — delete\\ 3. ''list'' — display information for the specified ''IP_list'' or all information if the ''all'' argument is specified. | In the ''list'' and ''del'' commands, ''all'' can be specified instead of an IP/LOGIN list, meaning the command is applied to all entries. |
| ''policing_description_file''| File in ''cfg'' format, for example: ''tbf.cfg'' | |
| ''IP_list'' | Values:\\ 1. ''--file'' — file containing a list of IP addresses\\ 2. ''--ip'' — single IP address, format: ''192.168.0.1''\\ 3. ''--ip_range'' — IP address range (inclusive), format: ''192.168.0.1-192.168.0.5''\\ 4. ''--cidr'' — CIDR notation, format: ''192.168.0.0/30, 5.200.43.0/24~'' (CIDR notation with excluded boundary addresses) | The first and last addresses can be excluded from a CIDR range (according to classless addressing conventions, these are the gateway and broadcast addresses) by adding the ''~'' character to the end of the CIDR definition, for example: ''--cidr 5.200.43.0/24~'' |
| ''LOGIN_list'' | Values:\\ 1. ''--file'' — file containing a list of logins\\ 2. ''--login'' — single login, format: USER1, "FIRST_NAME LAST_NAME" (login specified with escaped special characters) | "USER1" — login specified in double quotes\\ 'USER2' — login specified in single quotes |
A line beginning with the ''#'' character is treated as a comment.
====== Creating, assigning, and removing policing profiles ======
Creating a named policing profile and assigning it to a subscriber:
fdpi_ctrl load profile --policing ./rate_10Mbps.cfg --profile.name rate_10Mbps
fdpi_ctrl load --policing --profile.name rate_10Mbps --ip 192.168.0.1
fdpi_ctrl load --policing --profile.name rate_10Mbps --login test
[[en:dpi:dpi_components:platform:subscriber_management:subsman_res|]]
Assigning an anonymous policing profile using a policing configuration file:
fdpi_ctrl load --policing rate_10Mbps.cfg --ip 192.168.0.1
fdpi_ctrl load --policing rate_10Mbps.cfg --login test
Removing policing for a specific subscriber:
fdpi_ctrl del --policing --ip 192.168.0.1
fdpi_ctrl del --policing --login test
====== Policing management commands ======
Display a list of all created and applied policing profiles:
fdpi_ctrl list all --policing
Display a list of all subscribers by policing profile name:
fdpi_ctrl list all --policing --profile.name rate_10Mbps
Display information for a specific subscriber:
fdpi_ctrl list --policing --ip 192.168.0.1
fdpi_ctrl list --policing --login test
Delete a named profile (the profile must not be assigned to any subscribers before deletion):
fdpi_ctrl del profile --policing --profile.name rate_10Mbps
Display the settings of a policing profile (tariff plan) by name:
fdpi_ctrl list profile --policing --profile.name rate_10Mbps
Change the policing settings from the daytime profile (10 Mbps) to the nighttime profile (20 Mbps). The new settings are immediately applied to all subscribers using the specified policing profile:
fdpi_ctrl load profile --policing ./rate_20Mbps_night.cfg --profile.name rate_10Mbps