Example for Limiting Traffic
Networking Requirements
As shown in Figure 12-5, an enterprise connects to the Internet through the Router as the gateway. To ensure network quality, bandwidth use efficiency, and normal running of services, the device detects FileShare_P2P packets of BT and eDonkey_eMule and limits the rate of the FileShare_P2P packets within 4 Mbit/s.
Configuration Roadmap
The configuration roadmap is as follows:
Enable deep security defense and load a signature file.
Configure a traffic classifier and define a rule matching the FileShare_P2P group.
Configure a traffic behavior and limit the rate of FileShare_P2P packets within 4 Mbit/s.
Configure a traffic policy and bind the traffic classifier and traffic behavior to the traffic policy.
Apply the traffic policy to the inbound direction of the WAN interface and enable the SA statistics function on the interface for the SAC configurations to take effect.
Procedure
- Enable deep security defense and load a signature file.
<Huawei> system-view [Huawei] sysname Router [Router] engine enable
- Configure a traffic classifier to identify FileShare_P2P packets.
[Router] traffic classifier p2p [Router-classifier-p2p] if-match category FileShare_P2P [Router-classifier-p2p] quit
- Configure a traffic behavior and limit the rate of FileShare_P2P packets.
[Router] traffic behavior p2p [Router-behavior-p2p] car cir 4096 [Router-behavior-p2p] quit
- Configure a traffic policy and bind the traffic classifier and traffic behavior to the traffic policy.
[Router] traffic policy p2p [Router-trafficpolicy-p2p] classifier p2p behavior p2p [Router-trafficpolicy-p2p] quit
- Apply the traffic policy to the inbound direction of WAN-side Layer 3 interface GE2/0/0 and enable the SA statistics function on the interface for the SAC configurations to take effect.
[Router] interface gigabitethernet 2/0/0 [Router-GigabitEthernet2/0/0] traffic-policy p2p inbound [Router-GigabitEthernet2/0/0] sa application-statistic enable [Router-GigabitEthernet2/0/0] quit
- Run the display current-configuration command to check the configuration.
Configuration Files
Configuration file of the Router
# sysname Router # engine enable # traffic classifier p2p operator or if-match category FileShare_P2P # traffic behavior p2p car cir 4096 cbs 770048 pbs 1282048 mode color-blind green pass yellow pass red discard # traffic policy p2p classifier p2p behavior p2p precedence 5 # interface GigabitEthernet2/0/0 traffic-policy p2p inbound sa application-statistic enable # return