Sometimes your asked to tune down certain hosts only during business hours to conserve bandwidth. I always tell them the easiest way to control this is at the switch at a physical level using tcl scripts and scheduled kron jobs. In this example, the port is limited to 1MB at 8:00 AM daily, but the limit is removed at 5:00PM.

First, create the script

You can do this in notepad and upload using tftp. I prefer using the cli directly:

switch#tclsh
switch(tcl)#puts [open “flash:portlimit1.tcl” w+] { ios_config “interface Gi1/0/10” “speed 10” “bandwidth 10” “srr-queue bandwidth limit 10” }
switch(tcl)#puts [open “flash:portlimit0.tcl” w+] { ios_config “interface Gi1/0/10” “speed 1000” “bandwidth 1000” “no srr-queue bandwidth limit 10” }

Next, define the kron policies

kron policy-list turnUp
tclsh portlimit0.tcl

kron policy-list turnDown
tclsh portlimit1.tcl

Then, schedule the kron job

kron occurence open at 08:00 recurring
policy-list turnDown

kron occurence closed at 17:00 recurring
policy-list turnUp

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post Navigation