This section describes how to configure, import, and export user-defined URL categories.
User-defined URL categories include manually created user-defined categories and user-defined categories that are manually added to predefined categories. Both types of user-defined categories can be imported and exported in batches. For example:
Some employees on an enterprise access non-work-related websites, such as www.example1.com and www.example2.com during working hours, which adversely affects work efficiency and brings intangible assets loss to enterprises. Therefore, the enterprise wants to control the websites that employees can access and allows employees to access only work-related websites.
After querying the category database on the FW, the administrator of the enterprise can find that:
www.example1.com does not belong to any predefined URL category.
www.example2.com belongs to predefined URL category Blogs/Community.
Create the user-defined URL category forbidden website, add www.example1.com to the user-defined URL category, add www.example2.com to the predefined category Blogs/Community, and set the response action to Block. In this way, the problem faced by the enterprise can be solved. The specific configuration method is as follows.
You can also create a user-defined category in the URL filtering profile. Choose . In the URL filtering level in the URL filtering profile, click Add URL Category next to the User-defined Category.

on the right of the predefined category Blogs/Community to which the URL category is to be added or select the Social Network category and click the name of the Blogs/Community category, and then add www.example2.com to the predefined category.
Name |
url_profile_01 |
|---|---|
Default Action |
Block |
URL Filtering Level |
Set the action for user-defined category forbidden website to Block. Set the action of the predefined category Blogs/Community to Block. |
The configuration does not take effect immediately after you create or modify the profile. You must click Commit on the upper right of the interface to apply the configuration. To save time, you can commit the configuration after all operations on the profile are complete.
url-filter category user-defined name category-name
description description
add { url url-text &<1-2> | host host-text &<1-2> }
url-filter category pre-defined subcategory-id subcategory-id
add { url url-text &<1-2> | host host-text &<1-2> }
profile type url-filter name name
category { pre-defined [ category-id category-id | subcategory-id subcategory-id ] | user-defined [ name category-name ] } action { allow | alert | block | qos remark dscp dscp-value }
The new or modified security profile does not take effect until you run the engine configuration commit command to commit the configuration. To save time, you can submit the configuration after all operations on the profile are complete.
Configuration Example
<sysname> system-view [sysname] url-filter category user-defined name "forbidden website" [sysname-cate-user-defined-forbidden website] description for forbidden website [sysname-cate-user-defined-forbidden website] add url www.example1.com [sysname-cate-user-defined-forbidden website] quit [sysname] url-filter category pre-defined subcategory-id 108 [sysname-cate-pre-defined-108] add url www.example2.com [sysname-cate-pre-defined-108] quit [sysname] profile type url-filter name url_profile_01 [sysname-profile-url-filter-url_profile_01] category user-defined action block [sysname-profile-url-filter-url_profile_01] category pre-defined subcategory-id 108 action block
When the matching mode of URL/Host rules is set to exact matching mode and the string length of the rules ranges from 256 to 511 characters, the rules can be added to predefined categories only through the TXT template.
Parameter |
Description |
|---|---|
Select a .csv or .txt file to upload. |
Click Browse, select the edited CSV file or TXT file, and click Open. |
Overwrite existing URLs |
When a user-defined URL category already exists, you can:
|
After the import is complete, you can view all imported user-defined URL categories in User-defined.
URL category changes do not take effect immediately. You need to click Commit on the upper right of the web page to activate them. To save time, you can commit changes after all changes are made.
You can export user-defined URL categories into a CSV file or TXT file, and save the file on an external storage drive for backup. Then you can import the CSV file or TXT file into a FW to create user-defined URL categories in a batch.