| |
| en:dpi:dpi_components:platform:subscriber_management:policing_mng [2024/09/26 15:29] – created - external edit 127.0.0.1 | en:dpi:dpi_components:platform:subscriber_management:policing_mng [2026/06/29 09:20] (current) – elena.krasnobryzh |
|---|
| ====== Policing Management ====== | ====== Traffic policing management. Named policing profiles ====== |
| {{indexmenu_n>3}} | {{indexmenu_n>3}} |
| Subscriber management is performed using the utility ''fdpi_ctrl''. | Policing profiles are created, modified, and deleted using the ''fdpi_ctrl'' utility. |
| <note important>We recommend using [[en:dpi:dpi_components:platform:subscriber_management:subsman_profiles]], which simplifies policing management.</note> | |
| |
| ===== Command Syntax ===== | Policing profiles are divided into two types: |
| The general format of commands: | * **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: |
| <code bash>fdpi_ctrl command --policing policing_description_file [IP_list] [LOGIN_list]</code> | <code bash>fdpi_ctrl command --policing policing_description_file [IP_list] [LOGIN_list]</code> |
| |
| Explanation of command parameters: | Command parameter description: |
| ^ Parameter ^ Description, possible values, and format ^ Note ^ | ^ Parameter ^ Description, possible values, and format ^ Note ^ |
| | ''command'' | Values:\\ 1. ''load'' — load data\\ 2. ''del'' — delete. For ''--service'', you need to specify the ''service_identifier''\\ 3. ''list'' — display information for the specified ''IP_list'' or all information if the ''all'' argument is provided. | In ''list'' and ''del'' commands, instead of an IP/LOGIN list, you can specify ''all'', meaning the command will apply to all. | | | ''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''| A file in ''cfg'' format, e.g., ''tbf.cfg'' | | | | ''policing_description_file''| File in ''cfg'' format, for example: ''tbf.cfg'' | | |
| | ''IP_list'' | Values:\\ 1. ''--file'' — file with a list of IPs\\ 2. ''--ip'' — single IP, format: ''192.168.0.1''\\ 3. ''--ip_range'' — IP range (inclusive), format: ''192.168.0.1-192.168.0.5''\\ 4. ''--cidr'' — IP with port, format: ''192.168.0.0/30, 5.200.43.0/24~'' (CIDR format with excluded boundary addresses) | Boundary addresses can be excluded from a CIDR range (following the classless addressing agreement — gateway and broadcast addresses) by adding the ''~'' symbol at the end of the CIDR definition, e.g., ''--cidr 5.200.43.0/24~''. | | | ''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 with a list of logins\\ 2. ''--login'' — single login, format: USER1, "FIRST_NAME LAST_NAME" (alternative for specifying a login with escaped special characters) | "USER1" — option for specifying login in double quotes\\ 'USER2' — option for specifying login in single quotes | | | ''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 | |
| <note>A line starting with ''#'' is a comment.</note> | <note>A line beginning with the ''#'' character is treated as a comment.</note> |
| | |
| | ====== Creating, assigning, and removing policing profiles ====== |
| | |
| | Creating a named policing profile and assigning it to a subscriber: |
| | <code bash> |
| | 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 |
| | </code> |
| | |
| | <note important>[[en:dpi:dpi_components:platform:subscriber_management:subsman_res|]]</note> |
| | |
| | Assigning an anonymous policing profile using a policing configuration file: |
| | <code bash> |
| | fdpi_ctrl load --policing rate_10Mbps.cfg --ip 192.168.0.1 |
| | fdpi_ctrl load --policing rate_10Mbps.cfg --login test |
| | </code> |
| | |
| | Removing policing for a specific subscriber: |
| | <code bash> |
| | fdpi_ctrl del --policing --ip 192.168.0.1 |
| | fdpi_ctrl del --policing --login test |
| | </code> |
| | |
| | ====== Policing management commands ====== |
| | |
| | Display a list of all created and applied policing profiles: |
| | <code bash>fdpi_ctrl list all --policing</code> |
| | |
| | Display a list of all subscribers by policing profile name: |
| | <code bash> |
| | fdpi_ctrl list all --policing --profile.name rate_10Mbps |
| | </code> |
| | |
| | Display information for a specific subscriber: |
| | <code bash> |
| | fdpi_ctrl list --policing --ip 192.168.0.1 |
| | fdpi_ctrl list --policing --login test |
| | </code> |
| | |
| | Delete a named profile (the profile must not be assigned to any subscribers before deletion): |
| | <code bash> |
| | fdpi_ctrl del profile --policing --profile.name rate_10Mbps |
| | </code> |
| | |
| | Display the settings of a policing profile (tariff plan) by name: |
| | <code bash> |
| | fdpi_ctrl list profile --policing --profile.name rate_10Mbps |
| | </code> |
| |
| ===== Examples ===== | 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: |
| - Enable policing policy using a policing description file: <code bash>fdpi_ctrl load --policing tbf.cfg --ip 192.168.0.1</code> | <code bash> |
| - Get a list of applied policing: <code bash>fdpi_ctrl list all --policing</code> | fdpi_ctrl load profile --policing ./rate_20Mbps_night.cfg --profile.name rate_10Mbps |
| - Get information for a specific IP: <code bash>fdpi_ctrl list --policing --ip 192.168.0.1</code> | </code> |
| - Enable policing policy using a named profile: <code bash>fdpi_ctrl load --policing --profile.name tariff_10 --login kv_111</code> | |