| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| en:dpi:dpi_components:platform:subscriber_management:subsman_cmd [2026/03/18 12:05] – [Examples] elena.krasnobryzh | en:dpi:dpi_components:platform:subscriber_management:subsman_cmd [2026/07/02 14:11] (current) – ↷ Links adapted because of a move operation elena.krasnobryzh |
|---|
| {{tag>Services}} | {{tag>Services}} |
| ====== Service Management ====== | ====== Service management. Named service profiles ====== |
| {{indexmenu_n>3}} | {{indexmenu_n>3}} |
| Subscriber management is performed using the utility ''fdpi_ctrl''. | Service 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 will simplify service management.</note> | Services are divided into three types: |
| ===== Command Syntax ===== | * **Without a profile** — the service settings are described in the DPI configuration or do not require a description, for example, Service 9 (billing NetFlow/RADIUS Accounting export) |
| | * **Anonymous (unnamed) profiles** — the service is not created in advance; its parameters are specified when the service is assigned to a subscriber in JSON format |
| | * **Named profiles** — the service 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: | General command format: |
| <code bash>fdpi_ctrl command --service service_id [IP_list] [LOGIN_list]</code> | <code bash>fdpi_ctrl command --service service_identifier [IP_list] [LOGIN_list]</code> |
| |
| Command parameter breakdown: | 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'', the ''service_id'' must be specified\\ 3. ''list'' — show information for the specified ''IP_list'' or all information if the argument ''all'' is specified. | In the ''list'' and ''del'' commands, instead of an IP/LOGIN list, you can specify ''all'', which applies the command to all. | | | ''command'' | Values:\\ 1. ''load'' — load data\\ 2. ''del'' — delete. For ''--service'', ''service_identifier'' must be specified\\ 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. | |
| | ''service_id'' | Numeric ID corresponding to a service from the [[en:dpi:dpi_components:platform:subscriber_management:subsman_cmd#list_of_services|list]]. | | | | ''service_identifier'' | Numeric ID corresponding to a service from the [[en:dpi:dpi_components:platform:subscriber_management:subsman_cmd#list_of_services|list]] | | |
| | ''IP_list'' | Values:\\ 1. ''--file'' — file with IP list\\ 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 range with excluded boundary addresses) | The CIDR range can exclude boundary addresses (gateway and broadcast addresses under classless addressing) 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 login list\\ 2. ''--login'' — single login, format: USER1, "FIRST_NAME LAST_NAME" (option to use login with escaped special characters) | "USER1" — example of using login in double quotes\\ 'USER2' — example of using 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> |
| ===== List of Services ===== | |
| |
| <note tip>When enabling blocking services (4, 16, 49), only TCP traffic is blocked. To block UDP traffic as well, you need to enable the ''[[en:dpi:dpi_components:platform:subscriber_management:subsman_cmd#tcp_and_udp_protocol_blocking_configuration|udp_block]]'' parameter.</note> | =====Service list===== |
| |
| ^ ID ^ Short Description ^ Link to Detailed Description ^ | <note tip>When blocking services (4, 16, 49) are activated, only TCP traffic is blocked. To block UDP traffic as well, [[en:dpi:dpi_components:platform:subscriber_management:subsman_cmd#tcp_and_udp_protocol_blocking_configuration|enable]] the ''[[en:dpi:dpi_components:platform:subscriber_management:subsman_cmd#tcp_and_udp_protocol_blocking_configuration|udp_block]]'' parameter.</note> |
| | 1 | Bonus program | [[en:dpi:dpi_options:opt_cosmobonus:bonus_mgmt|Description]] | | |
| | 2 | Advertising | [[en:dpi:dpi_options:opt_advertising:ads_mgmt|Description]] | | |
| | 3 | Ad blocking | [[en:dpi:dpi_options:opt_advertising:ads_mgmt|Description]] | | |
| | 4 | Blacklist filtering | [[en:dpi:dpi_options:opt_filtration:filtration_ctrl#activation_of_filtering_service_management_at_the_subscriber_level|Description]] | | |
| | 5 | Whitelist and Captive Portal | [[en:dpi:dpi_options:opt_capture:capt_mgmt#management_of_default_profile_5_service|Description]] | | |
| | 6 | HTTP redirect notification | [[en:dpi:dpi_components:platform:subscriber_management:subsman_profiles|Description]] | | |
| | 7 | Caching | [[en:dpi:dpi_options:opt_cache:cache_ctrl|Description]] | | |
| | 8 | Passed DDOS protection | [[en:dpi:dpi_options:opt_ddos:ddos_ddos:ddos_ddos_settings|Description]] | | |
| | 9 | RADIUS accounting / netflow statistics collection for billing | [[en:dpi:bras_bng:radius_integration:radius_accounting|Description]] | | |
| | 10 | DDOS protection | [[en:dpi:dpi_options:opt_ddos:ddos_ctrl|Description]] | | |
| | 11 | CGNAT and NAT 1:1 | [[en:dpi:opt_cgnat|Description]] | | |
| | 12 | Traffic recording in PCAP | [[en:dpi:dpi_options:opt_li:li_ctrl#managing_pcap_recording|Description]] | | |
| | 13 | Mini Firewall | [[en:dpi:dpi_options:opt_firewall|Description]] | | |
| | 14 | Traffic diversion to the TAP interface | [[en:dpi:dpi_options:dpi_divert_spec|Description]] | | |
| | 15 | Special subscriber (all traffic goes to cs0, filtering service (4) is not applied to vChannel and general channel) | [[en:dpi:dpi_options:opt_bandwidth_mgmt:vipsub|Description]] | | |
| | 16 | Whitelist and redirection to Captive Portal without internet access | [[en:dpi:dpi_options:opt_capture:capt_mgmt#management_of_named_profile_16_service|Description]] | | |
| | 17 | Traffic mirroring to a specified VLAN | [[en:dpi:dpi_options:opt_li:li_ctrl#mirroring_to_vlan|Description]] | | |
| | 18 | Session-based policing for certain protocols and traffic classification at channel and subscriber levels | [[en:dpi:dpi_options:opt_shaping:shaping_session|Description]] | | |
| | 19 | DNS response substitution, future plans: redirect DNS queries to the provider's DNS server | [[en:dpi:dpi_options:dns_substitution|Description]] | | |
| | 49 | IPv6 traffic blocking | [[en:dpi:dpi_options:opt_filtration:filtration_ctrl#activation_of_ipv6_traffic_blocking_service|Description]] | | |
| | 50 | Participant in a marketing campaign with notification via HTTP redirect | [[en:dpi:dpi_components:dpiui:user_guide:ssg_control_section:ad_campaign_management|Description]] | | |
| | 51 | Reserved (internal service) | | | |
| | 254 | VRF | [[en:dpi:dpi_components:router#subscriber_vrf_management|Description]] | | |
| |
| ===== Examples ===== | ^ ID ^ Brief description ^ Link to detailed description ^ |
| - Enable service: <code bash>fdpi_ctrl load --service 9 --ip 192.168.0.1 | | 1 | bonus program | [[en:dpi:dpi_options:opt_cosmobonus:bonus_mgmt|Description]] | |
| # or | | 2 | advertising | [[en:dpi:dpi_options:opt_advertising:ads_mgmt|Description]] | |
| fdpi_ctrl load --service 9 --login USER1</code> | | 3 | ad blocking | [[en:dpi:dpi_options:opt_advertising:ads_mgmt|Description]] | |
| - Disable service: <code bash>fdpi_ctrl del --service 9 --ip 192.168.0.1</code> | | 4 | blacklist filtering | [[en:dpi:dpi_options:opt_filtration:filtration_ctrl#service_filtering_management_at_the_subscriber_level_-_subscriber_management|Description]] | |
| - Get list with the connected service: <code bash>fdpi_ctrl list all --service 9</code> | | 5 | whitelist and Captive Portal | [[en:dpi:dpi_options:opt_capture:capt_mgmt#default_profile_management_for_service_5|Description]] | |
| - Get information for a specific IP: <code bash>fdpi_ctrl list --service 9 --ip 192.168.0.1</code> | | 6 | notification via HTTP redirect | [[en:dpi:dpi_components:platform:subscriber_management:subsman_cmd#service_management_commands|Description]] | |
| - When specifying the IP list, you can simultaneously specify several options: ''--file'', ''--ip'', ''--ip_range'', ''--cidr'': <code bash> | | 7 | caching | [[en:dpi:dpi_options:opt_cache:cache_ctrl|Description]] | |
| fdpi_ctrl list --service 9 --ip 192.168.0.1 --ip 192.168.0.2 --file fip_1.txt --ip_range 192.168.0.3-192.168.0.6 --login USER1</code> The operation will apply to all specified elements where no error occurred.\\ :!: If an error occurs, changes are not rolled back! | | 8 | DDoS protection passed | [[en:dpi:dpi_options:opt_ddos:ssg_ddos:ddos_ddos:ddos_ddos_settings|Description]] | |
| - Enabling services with named profiles: <code bash>fdpi_ctrl load --service 4 --profile.name blocked --login Test</code> | | 9 | RADIUS accounting / NetFlow statistics collection for billing | [[en:dpi:bras_bng:radius_integration:radius_accounting|Description]] | |
| - List all profiles for the service: <code bash>fdpi_ctrl list all profiles --service 5</code> | | 10 | DDoS protection | [[en:dpi:dpi_options:opt_ddos:ddos_ctrl|Description]] | |
| | | 11 | CGNAT and NAT 1:1 | [[en:dpi:opt_cgnat|Description]] | |
| | | 12 | PCAP traffic recording | [[en:dpi:dpi_components:platform:li_ctrl#pcap_recording_management|Description]] | |
| | | 13 | mini Firewall | [[en:dpi:dpi_options:opt_firewall|Description]] | |
| | | 14 | traffic diversion to a TAP interface | [[en:dpi:dpi_options:dpi_divert_spec|Description]] | |
| | | 15 | special subscriber (all traffic is assigned to cs0; filtering (Service 4) is not applied for the vChannel and the common channel) | [[en:dpi:dpi_options:opt_bandwidth_mgmt:vipsub|Description]] | |
| | | 16 | whitelist and redirection to the Captive Portal without Internet access | [[en:dpi:dpi_options:opt_capture:capt_mgmt#named_profile_management_for_service_16|Description]] | |
| | | 17 | traffic mirroring to the specified VLAN | [[en:dpi:dpi_components:platform:li_ctrl#vlan_mirroring|Description]] | |
| | | 18 | session policing for specific protocols and traffic class identification at the channel and subscriber levels | [[en:dpi:dpi_options:opt_shaping:shaping_session|Description]] | |
| | | 19 | DNS response substitution; planned: redirecting DNS queries to the provider's DNS server | [[en:dpi:dpi_options:dns_substitution|Description]] | |
| | | 49 | IPv6 traffic blocking | [[en:dpi:dpi_options:opt_filtration:filtration_ctrl#ipv6_traffic_blocking_service_activation|Description]] | |
| | | 50 | marketing campaign participant with notification via HTTP redirect | [[en:dpi:dpi_components:dpiui:user_guide:ssg_control_section:ad_campaign_management|Description]] | |
| | | 51 | reserved (internal service) | | |
| | | 254 | VRF | [[en:dpi:dpi_components:router#subscriber_vrf_management|Description]] | |
| |
| ===== TCP and UDP Protocol Blocking Configuration ===== | ====== Creating, enabling, and disabling services ====== |
| The parameter ''udp_block'' is responsible for blocking the UDP protocol. If the ''udp_block'' parameter is present in the DPI configuration file ''/etc/dpi/fastdpi.conf'', both TCP and UDP will be blocked; if absent, only TCP will be blocked. | |
| |
| To start blocking UDP protocols (e.g., QUIC), add the ''udp_block'' parameter with a value of 2 or 3 (start blocking after two or three passed packets). These values are set because sometimes a large number of individual packets pass, which are not accounted for in the traffic but can put a heavy load on DPI. | <note important>Profile names are unique within each service. For example, ''profile_name_1'' for Service 4 (blacklist) is different from ''profile_name_1'' for Service 5 (whitelist).</note> |
| <code bash>udp_block=3</code> | |
| |
| Adding the parameter does not require a DPI restart; a simple reload is sufficient: | Creating a named profile for Service 6 (one-time redirect), operator news notification, and assigning this service with the profile to a subscriber: |
| <code bash> | <code bash> |
| service fastdpi reload | fdpi_ctrl load profile --service 6 --profile.name redir_to_news --profile.json '{ "redirect" : "http://mysite.com/ips_news", "check" : true }' |
| | fdpi_ctrl load --service 6 --profile.name redir_to_news --ip 192.168.0.1 |
| | fdpi_ctrl load --service 6 --profile.name redir_to_news --login test |
| </code> | </code> |
| | |
| | <note important>[[en:dpi:dpi_components:platform:subscriber_management:subsman_res|]]</note> |
| | |
| | Assigning Service 6 without a profile (the service parameters are taken from the DPI configuration file): |
| | <code bash> |
| | fdpi_ctrl load --service 6 --ip 192.168.0.1 |
| | fdpi_ctrl load --service 6 --login test |
| | </code> |
| | |
| | Assigning Service 6 with an anonymous profile (an unnamed profile that exists until the service is disabled for the subscriber): |
| | <code bash> |
| | fdpi_ctrl load --service 6 --profile.json '{ "redirect" : "http://mysite.com/ips_news", "check" : true }' --ip 192.168.0.1 |
| | fdpi_ctrl load --service 6 --profile.json '{ "redirect" : "http://mysite.com/ips_news", "check" : true }' --login test |
| | </code> |
| | |
| | Disabling Service 6 for a specific subscriber: |
| | <code bash> |
| | fdpi_ctrl del --service 6 --ip 192.168.0.1 |
| | fdpi_ctrl del --service 6 --login test |
| | </code> |
| | |
| | ====== Service management commands ====== |
| | |
| | Get a list of all subscribers with Service 6 enabled: |
| | <code bash>fdpi_ctrl list all --service 6</code> |
| | |
| | Find subscribers with Service 6 assigned using a specific named profile: |
| | <code bash> |
| | fdpi_ctrl list all --service 6 --profile.name redir_to_news |
| | </code> |
| | |
| | Get information for a specific IP address for Service 6: |
| | <code bash>fdpi_ctrl list --service 6 --ip 192.168.0.1</code> |
| | |
| | Delete a named profile (the profile must not be assigned to any subscribers before deletion): |
| | <code bash> |
| | fdpi_ctrl del profile --service 6 --profile.name redir_to_news |
| | </code> |
| | |
| | Modify the settings of a service with a named profile (the new settings will be applied to all subscribers using the specified service profile): |
| | <code bash> |
| | fdpi_ctrl load profile --service 6 --profile.name redir_to_news --profile.json '{ "redirect" : "http://mysite.com/ips_news_new", "check" : true }' |
| | </code> |
| | |
| | Display all created profiles for all services: |
| | <code bash> |
| | fdpi_ctrl list all profile --service |
| | </code> |
| | |
| | When specifying an IP list, multiple options can be used simultaneously: ''--file'', ''--ip'', ''--ip_range'', ''--cidr'': |
| | <code bash> |
| | fdpi_ctrl list --service 6 --ip 192.168.0.1 --ip 192.168.0.2 --file fip_1.txt --ip_range 192.168.0.3-192.168.0.6 --login USER1 |
| | </code> |
| | |
| | The operation will be applied to all specified entries for which no error occurred. |
| | |
| | :!: If an error occurs, previously applied changes are **not** rolled back! |
| | |
| | <note tip>[[en:dpi:dpi_components:platform:dpi_admin:tcp_udp|]]</note> |