某公司希望在上班时间对员工进行每IP限速,其他时间不限制。
1.主要配置如下:
#创建关闭接口g0/1的限速功能
scheduler job close-car-g0/1
command 1 system-view
command 2 interface g0/1
command 3 undo qos car inbound carl 1
#创建开启接口g0/1的限速功能
scheduler job start-car-g0/1
command 1 system-view
command 2 interface g0/1
command 3 qos car inbound carl 1 cir 500 cbs 1875 ebs 0 green pass red discard
#配置定时执行任务,使设备在星期一到星期五的下午六点关闭对应的限速功能。
scheduler schedule close-car-g0/1
user-role network-admin
job close-car-g0/1
time repeating at 18:00 week-day Mon Tue Wed Thu Fri
#配置定时执行任务,使设备在星期一到星期五的上午八点开启对应的限速功能。
scheduler schedule start-car-g0/1
user-role network-admin
job start-car-g0/1
time repeating at 08:00 week-day Mon Tue Wed Thu Fri
2.结果验证:
#显示Job的配置信息
[H3C]display scheduler job
Job name: close-car-g0/1
system-view
interface g0/1
undo qos car inbound carl 1
Job name: start-car-g0/1
system-view
interface g0/1
qos car inbound carl 1 cir 500 cbs 1875 ebs 0 green pass red discard
#显示定时任务的运行信息。
[H3C]display scheduler schedule
Schedule name : close-car-g0/1
Schedule type : Run on every Mon Tue Wed Thu Fri at 18:00:00
Start time : Wed Sep 28 08:00:00 2016
Last execution time : Wed Sep 28 08:00:00 2016
Last completion time : Wed Sep 28 08:00:03 2016
Execution counts : 1
Job name Last execution status
close-car-g0/1 Successful
Schedule name : start-car-g0/1
Schedule type : Run on every Mon Tue Wed Thu Fri at 18:00:00
Start time : Wed Sep 28 08:00:00 2016
Last execution time : Wed Sep 28 08:00:00 2016
Last completion time : Wed Sep 28 08:00:03 2016
Execution counts : 1
Job name Last execution status
start-car-g0/1 Successful
定时任务相当于在某一时间自动输入配置好的命令,注意一定不要忘了system-view这一条。