Interface-based rate limiting is easy to configure and limits the rate of all packets sent or received on an interface regardless of packet type. An interface enabled with this function can be assigned fixed bandwidth.
Interface-based rate limiting in the inbound and outbound directions can be configured simultaneously or separately.
For applicable product models and versions, see Applicable Product Models and Versions.
For details about software mappings, visit Hardware Query Tool and search for the desired product model.
In Figure 1, the Switch connects to the router through GE0/0/3, and departments 1 and 2 are connected to the Switch through GE0/0/1 and GE0/0/2 respectively and access the Internet through the Switch and router.
Services are singular, and therefore do not need to be differentiated. With finite network bandwidth, bandwidth of each department needs to be limited. Department 1 requires the CIR of 8 Mbit/s in the outbound direction, and department 2 requires the CIR of 5 Mbit/s in the outbound direction.
# Create VLAN 100, VLAN 200, and VLAN 300.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] vlan batch 100 200 300
# Configure GE0/0/1, GE0/0/2, and GE0/0/3 as trunk interfaces, and configure GE0/0/1 to allow VLAN 100, GE0/0/2 to allow VLAN 200, and GE0/0/3 to allow VLAN 100, VLAN 200, and VLAN 300.
[Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] port link-type trunk //Set the link type of the interface to trunk. The default link type of the interface is not trunk. [Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 [Switch-GigabitEthernet0/0/1] quit [Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] port link-type trunk [Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 200 [Switch-GigabitEthernet0/0/2] quit [Switch] interface gigabitethernet 0/0/3 [Switch-GigabitEthernet0/0/3] port link-type trunk [Switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 100 200 300 [Switch-GigabitEthernet0/0/3] quit
# Create VLANIF 300 and set its IP address to 192.168.1.1/24.
[Switch] interface vlanif 300 [Switch-Vlanif300] ip address 192.168.1.1 24 [Switch-Vlanif300] quit
On the router, set the IP address of the interface connected to the Switch to 192.168.1.2/24, and configure sub-interfaces on the interface to terminate VLANs.
# Configure rate limiting on GE0/0/1 in the inbound direction and set the CIR to 8192 kbit/s.
[Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] qos lr inbound cir 8192 //Set the CIR of department 1 in the outbound direction to 8 Mbit/s. [Switch-GigabitEthernet0/0/1] quit
# Configure rate limiting on GE0/0/2 in the inbound direction and set the CIR to 5120 kbit/s.
[Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] qos lr inbound cir 5120 //Set the CIR of department 2 in the outbound direction to 5 Mbit/s. [Switch-GigabitEthernet0/0/2] quit
# Check the interface-based rate limiting configuration.
[Switch] display qos lr inbound interface gigabitethernet 0/0/1 GigabitEthernet0/0/1 lr inbound: cir: 8192 Kbps, cbs: 1024000 Byte
[Switch] display qos lr inbound interface gigabitethernet 0/0/2 GigabitEthernet0/0/2 lr inbound: cir: 5120 Kbps, cbs: 640000 Byte
# GE0/0/1 on models excluding S5735-L, S5735S-L, S5735S-L-M, S5735-S, S5735-S-I, and S5735S-S is used as an example. When the rate of traffic on the interface in the inbound direction is larger than 8 Mbit/s, packet loss occurs. The traffic rate is limited within 8 Mbit/s.
[Switch] display qos statistics interface gigabitethernet 0/0/1 inbound --------------------------------------------------------- Item Value --------------------------------------------------------- Passed packets 30,715 Passed bytes - Dropped packets 16,555 Dropped bytes - ---------------------------------------------------------
Switch configuration file
# sysname Switch # vlan batch 100 200 300 # interface Vlanif300 ip address 192.168.1.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 qos lr inbound cir 8192 cbs 1024000 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 200 qos lr inbound cir 5120 cbs 640000 # interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan 100 200 300 # return
Product |
Product Model |
Software Version |
---|---|---|
S2700 |
S2752EI |
V100R006C05 |
S2720-EI |
V200R006C10, V200R009C00, V200R010C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S2750-EI |
V200R003C00, V200R005C00SPC300, V200R006C00, V200R007C00, V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00 |
|
S3700 |
S3700-SI and S3700-EI |
V100R006C05 |
S3700-HI |
V200R001C00 |
|
S5700 |
S5700-LI |
V200R001C00, V200R002C00, V200R003(C00&C02&C10), V200R005C00SPC300, V200R006C00, V200R007C00, V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00 |
S5700S-LI |
V200R001C00, V200R002C00, V200R003C00, V200R005C00SPC300, V200R006C00, V200R007C00, V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00 |
|
S5700-SI |
V200R001C00, V200R002C00, V200R003C00, V200R005C00 |
|
S5700-EI |
V200R001(C00&C01), V200R002C00, V200R003C00, V200R005(C00&C01&C02&C03) |
|
S5700-HI |
V200R001(C00&C01), V200R002C00, V200R003C00, V200R005(C00SPC500&C01&C02) |
|
S5710-C-LI |
V200R001C00 |
|
S5710-X-LI |
V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00 |
|
S5710-EI |
V200R001C00, V200R002C00, V200R003C00, V200R005(C00&C02) |
|
S5710-HI |
V200R003C00, V200R005(C00&C02&C03) |
|
S5720-LI and S5720S-LI |
V200R010C00, V200R011C00, V200R011C10, V200R012(C00&C20), V200R013C00, V200R019C00, V200R019C10 |
|
S5720-SI and S5720S-SI |
V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S5720I-SI |
V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S5720-EI |
V200R007C00, V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S5720-HI |
V200R006C00, V200R007(C00&C10), V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S5730-HI |
V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S5730-SI |
V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S5730S-EI |
V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S5731-H |
V200R013C02, V200R019C00, V200R019C10 |
|
S5731-S, S5731S-S |
V200R019C00, V200R019C10 |
|
S5731S-H |
V200R019C00, V200R019C10 |
|
S5732-H |
V200R019C00, V200R019C10 |
|
S5735-L, S5735S-L |
V200R019C00, V200R019C10 |
|
S5735S-L-M |
V200R019C00, V200R019C10 |
|
S5735-S, S5735S-S |
V200R019C00, V200R019C10 |
|
S5700 |
S5735-S-I |
V200R019C10 |
S6700 |
S6700-EI |
V200R001(C00&C01), V200R002C00, V200R003C00, V200R005(C00&C01&C02) |
S6720-LI and S6720S-LI |
V200R011C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S6720-SI and S6720S-SI |
V200R011C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S6720-EI |
V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S6720S-EI |
V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S6720-HI |
V200R012C00, V200R013C00, V200R019C00, V200R019C10 |
|
S6730-H |
V200R013C02, V200R019C00, V200R019C10 |
|
S6730-S, S6730S-S |
V200R019C00, V200R019C10 |
|
S6730S-H |
V200R019C10 |