This section describes how to configure a traffic policy. A traffic policy specifies bandwidth management objects and references a traffic profile.
The FW has a default traffic policy with all the matching conditions setting to "any" and the action setting to not limit.
Enable the public IP address matching function in the source NAT scenario.
Enable the public IP address matching function in the NAT server scenario.
rule name rule-name [ parent parent-rule-name ]
The parent parameter specifies a parent policy for the policy rule to be configured. The parent policy must already exist.
After creating a traffic policy rule, run the rule rename old-name new-name command to rename that policy rule.
description description
Policy functions must be clearly described so that an administrator can easily query and maintain the policy rules.
add tag tag-name
After policies reference tags, you can query policies based on tags and delete, move, enable, or disable policies in batches based on query results. For the tag description and configuration, see Tag.
A packet is considered to match a traffic policy only if the packet matches all the conditions in the traffic policy. A matching condition may specify multiple traffic attributes. A packet that matches any of the traffic attributes in the matching condition is considered to match the condition.
Policies must be configured from the most specific to the least specific.
| Function | Command |
|---|---|
Specify a source security zone or inbound interface. Either a source security zone or an inbound interface can be specified. If both commands are run, the latter command overrides the previous one. |
source-zone zone-name &<1-6> ingress-interface interface-type interface-number |
Specify a destination security zone or outbound interface. Either a destination security zone or an outbound interface can be specified. If both commands are run, the latter command overrides the previous one. |
destination-zone zone-name &<1-6> egress-interface interface-type interface-number |
Specify a source IP address or region. |
NOTE:
If the traffic limiting mode is per-IP CAR, the PC to limit traffic rate has multiple IP addresses, and all traffic from these IP addresses to the destination network passes through the FW, you need to add all the IP addresses to the traffic policy. Otherwise, traffic limiting might be inaccurate. For example, a PC accesses the Internet using IP addresses 10.3.1.1 and 10.3.2.1, and the maximum downstream bandwidth of the PC must be limited to 1 Mbit/s. You need to set both 10.3.1.1 and 10.3.2.1 as the source address matching condition in the traffic policy and reference the traffic profile with the downstream bandwidth limit set to 1 Mbit/s. |
Specify a destination IP address or region. |
|
Specify a user, user group or security-group. |
user { username user-name &<1-6> | user-group user-group-name &<1-6> | security-group security-group-name &<1-6> | any } |
Specify an application. |
application { any | app app-name &<1-6> | app-group app-group-name &<1-6> | category category-name [ sub-category sub-category-name &<1-6> ] | label label-name &<1-6> | software software-name &<1-6> } |
Specify a URL category. |
url { pre-defined { category { name category-name | category-id } | sub-category { name sub-category-name | sub-category-id } } | user-defined sub-category sub-category-name | any } |
Configure a service (by referencing a service or service group). |
|
Configure a service (by referencing a TCP/UDP/SCTP port or IP-layer protocol). |
|
Specify the validity period of a policy. |
time-range time-range-name |
Set a DSCP priority. |
dscp { dscp-value &<1-8> | any } |
action { qos profile profile-name | no-qos }
After completing the configuration, you can run the following commands to modify parameters:
After completing the configuration, you can use the following commands to view the logs on packet discarding based on the traffic policy:
Run the traffic-policy discard packet log enable command in the system view to enable the sending of logs on packet discarding based on traffic policies.
This function is disabled by default.
Run the traffic-policy discard packet log interval interval command in the system view to set the interval for sending the logs on packet discarding based on traffic policies.
The default interval is five minutes.
The logs on packet discarding based on traffic policies are sent to and output by the information center. For description of the information center, see Logs.