Hà Nội: NTT03, Line 1, Thống Nhất Complex, 82 Nguyễn Tuân, Thanh Xuân, Hà Nội. ● HCM: Số 31B, Đường 1, Phường An Phú, Quận 2 (Thủ Đức), TP HCM. ===> Đơn Vị Hàng Đầu Trong Lĩnh Vực Cung Cấp Thiết Bị Security - Network - Wifi - CCTV - Conference - Máy chủ Server - Lưu trữ Storge.
Danh mục sản phẩm

Configure Traffic Shaping Example

Network Requirements

  • There are two servers in the network, that is, Video server and Data server.
  • Configure the traffic shaping function; ensure that the video traffic rate is 20000kbps, but cannot exceed 20000kbps; the total of the video traffic rate and the data traffic rate does not exceed 50000kbps. When the video traffic rate is larger than 20000kbps, limit the video traffic rate as 20000kbps; when the video traffic rate is smaller than 20000kbps, the remaining bandwidth is occupied by the data traffic.

Network Topology

Networking of configuring the traffic shaping

Figure 1-5 Networking of configuring the traffic shaping

Configuration Steps

Step 1: Configure the link type of the VLAN and port on Device.

#Create VLAN2.

Device#configure terminal
Device(config)#vlan 2
Device(config-vlan2)#exit

#Configure the link type of port gigabitethernet0/1 as Access and permit the services of VLAN2 to pass.

Device(config)#interface gigabitethernet 0/1
Device(config-if-gigabitethernet0/1)#switchport mode access
Device(config-if-gigabitethernet0/1)#switchport access vlan 2

#Configure the link type of port gigabitethernet0/2 as Trunk and permit the services of VLAN2 to pass.

Device(config-if-gigabitethernet0/1)#interface gigabitethernet 0/2
Device(config-if-gigabitethernet0/2)#switchport mode trunk
Device(config-if-gigabitethernet0/2)#switchport trunk allowed vlan add 2
Device(config-if-gigabitethernet0/2)#exit

Step 2: Configure the L3 action group.

#Configure the L3 action group named LP7 and the action is to remark the packet to queue 7.

Device(config)#l3-action-group LP7
Device(config-action-group)#remark l2-priority 1p 7
Device(config-action-group)#exit

#Configure the L3 action group named LP6 and the action is to remark the packet to queue 6.

Device(config)#l3-action-group LP6
Device(config-action-group)#remark l2-priority 1p 6
Device(config-action-group)#exit

Step 3: Configure the IP standard ACL.

#Configure the IP standard ACL with serial number 1 on Device.

Device(config)#ip access-list standard 1

#Configure binding the rule with the L3 action group named LP7, realizing that the video traffic packet is remarked to queue 7.

Device(config-std-nacl)#permit host 100.0.0.1 l3-action-group LP7

#Configure binding the rule with the L3 action group named LP6, realizing that the video traffic packet is remarked to queue 6.

Device(config-std-nacl)#permit host 100.0.0.2 l3-action-group LP6
Device(config-std-nacl)#commit
Device(config-std-nacl)#exit

Step 4: Configure applying the IP standard ACL.

#Apply the IP standard ACL with serial number 1 to the ingress direction of port gigabitethernet0/1 on Device.

Device(config)#interface gigabitethernet 0/1
Device(config-if-gigabitethernet0/1)#ip access-group 1 in
Device(config-if-gigabitethernet0/1)#exit

#View the information of the ACL applied to the port on Device.

Device#show acl-object interface  
-----------Interface-----Bind-----Instance 	 
Interface----------------Direction----AclType---AclName 
gi0/1                    IN           IP        1            

Step 5: Configure the traffic shaping function.

#Configure the queue-based traffic shaping on port gigabitethernet0/2 and limit the rate of the traffic in queue 7 to 20000kbps.

Device(config)#interface gigabitethernet 0/2
Device(config-if-gigabitethernet0/2)#traffic-shape queue 7 cir 20000 pir 20000

#Configure the port-based traffic shaping on port gigabitethernet0/2 and limit the rate of the port traffic to 50000kbps.

Device(config-if-gigabitethernet0/2)#traffic-shape pir 50000
Device(config-if-gigabitethernet0/2)#exit

Step 6: Check the result.

#After the video traffic and data traffic are processed by Device, the total of the video traffic rate and the data traffic rate sent out from port gigabitethernet0/2 does not exceed 50000kbps. When the video traffic rate is larger than 20000kbps, limit the video traffic rate as 20000kbps; when the video traffic rate is smaller than 20000kbps, the remaining bandwidth can be occupied by the data traffic.