Using Generic Traffic Shaping
Problem
You want to do traffic shaping on an interface.
Solution
Generic Traffic Shaping works on an entire interface to limit the rate that it sends data. This first version restricts all outbound traffic to 500,000 bits per second:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface
Router(config-if)#
FastEthernet0/0
traffic-shape rate
Router(config-if)#
500000
exit
Router(config)#end
Router#
You can also specify traffic shaping for packets that match a particular access-list. This will buffer only the matching traffic, and leave all other traffic to use the default queuing mechanism for the interface:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#access-list
101
permit tcp any eq
www
any
Router(config)#access-list
101
permit tcp any any eq
Router(config)#
www
access-list
102
permit tcp any eq
ftp
any
Router(config)#access-list
102
permit tcp any any eq
Router(config)#
ftp
interface
Router(config-if)#
FastEthernet0/0
traffic-shape group
Router(config-if)#
101 100000
traffic-shape group
Router(config-if)#
102 200000
exit
Router(config)#end
Router#
There is also a newer class-based method for configuring traffic shaping on an interface using CBWFQ. We discuss this technique in Recipe 11.16.
Discussion
The first example shows how to configure an interface to restrict the total amount of outbound information. This is extremely useful when there is something ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.