Hi Expert,
My customer wants to configure interface rate limit with time base ACL in IOS-XR. But IOX-XR doesn't support Time-based ACL.
So I want to do it by EEM.
Demand:
At 8:00 clock system will set policy rate at 1Mbps every day. At 20:00 clock system will set policy rate at 1Mbps every day.
In the router, there are following configuration will configure in it.
policy-map day-express-1M
class class-default
police rate 10 mbps
end-policy-map
interface GigabitEthernet0/0/0/0
service-policy output day-express-1M
My Solution:
At IOS-XR
event manager environment _cron_entry1 00 08 * * *
event manager environment _cron_entry2 00 20 * * *
event manager directory user policy disk0:
aaa authorization eventmanager default group tacacs+ local
event manager policy Express_Day_Speed_Up.tcl username confile persist-time infinite type user
admin
username confile
group root-system
group cisco-support
secret 5 $1$//Ef$wt32iEErMUqbHEcd8lPEG1
In Express_Day_Speed_Up.tcl
::cisco::eem::event_register_timer cron name crontimer1 cron_entry $_cron_entry1
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
if {[catch {cli_open} result]} {
action_syslog priority info msg "CLI Open Failed: $result"
exit
}
set t_acl "policy-map day-express-1M
class class-default
police rate 1 mbps
!"
array set cli1 $result
action_syslog priority info msg "Express_Day_Speed_Up script"
cli_exec $cli1(fd) "conf t
$t_acl
commit"
action_syslog priority info msg "Speed-up script end"
if {[catch {cli_close $cli1(fd) $cli1(tty_id)} result]} {
action_syslog priority info msg $result
}
Question:
It can work when the router's clock at 8:00. And my problem is I need it set rate of policy-map "day-express-1M" be 10 mbps at 20:00 everyday. And I had already set event manager environment _cron_entry2 00 20 * * *.
How to write the script?
Thanks.