S600-E Series Switches Typical Configuration Examples
Example for Configuring Interface-based Rate Limiting
Overview
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.
Configuration Notes
This example applies to all versions of the S600-E.
For details about the hardware specifications and matched parts of the switch, visit Hardware Center. For details about the key specifications and full software specifications of the switch, visit Specifications Query.
Networking Requirements
In Figure 11-2, 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.
Configuration Roadmap
- Configure interfaces of the Switch so that users can access the Internet.
- Configure interface-based rate limiting on GE0/0/1 and GE0/0/2 of the Switch in the inbound direction.
Procedure
- Create VLANs and configure interfaces of the Switch.
# 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 interface-based rate limiting.
# 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
- Verify the configuration.
# 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
# Take GE0/0/1 as an example. Send packets to GE0/0/1 at the rates of 8000 kbit/s and 9000 kbit/s, and then run the display qos statistics interface gigabitethernet 0/0/1 inbound command to check traffic statistics on the interface. If the configuration is successful, packets sent at the rate of 8000 kbit/s pass through GE0/0/1 at 8000 kbit/s, with no packets discarded; packets sent at the rate of 9000 kbit/s pass through GE0/0/1 at 8192 kbit/s, with some packets discarded.
Configuration Files
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