有没有办法根据时间段关闭 Cisco 路由器上的接口?我想在不需要时关闭蜂窝接口。
这可以通过事件管理器和基于时间的访问列表或跟踪的组合来完成吗?
有没有办法根据时间段关闭 Cisco 路由器上的接口?我想在不需要时关闭蜂窝接口。
这可以通过事件管理器和基于时间的访问列表或跟踪的组合来完成吗?
您可以在谈论端口时使用基于时间的 ACL 或在谈论接口时使用 EEM 来做到这一点:
interface wlan0
ip address 10.1.1.1 255.255.255.0
ip access-group 101 in
access-list 101 permit tcp 10.1.1.0 0.0.0.255 172.16.1.0 0.0.0.255
eq telnet time-range EVERYOTHERDAY
time-range EVERYOTHERDAY
periodic Monday Wednesday Friday 8:00 to 17:00
来源:http : //www.cisco.com/en/US/products/sw/secursw/ps1018/products_tech_note09186a00800a5b9a.shtml#timebasedtimerange
当你想关闭一个界面时,看下一篇文章:
https://supportforums.cisco.com/thread/202630(回答约瑟夫·克拉克)
event manager applet shutdown_port
event timer cron cron-entry "0 0 * * *"
action 010 cli command "enable"
action 020 cli command "config t"
action 030 cli command "interface FastEthernet1/0/1"
action 040 cli command "shut"
action 050 cli command "end"
action 060 syslog msg "Interface FastEthernet1/0/1 has been shutdown"
event manager applet noshut_port
event timer cron cron-entry "0 8 * * *"
action 010 cli command "enable"
action 020 cli command "config t"
action 030 cli command "interface FastEthernet1/0/1"
action 040 cli command "no shut"
action 050 cli command "end"
action 060 syslog msg "Interface FastEthernet1/0/1 has been restored"
在上面的例子中:端口将在每天午夜关闭,并在每天早上 8 点恢复。
您应该查看 cron-entry 选项(如 linux/unix 中的 crontabs)参考:http : //www.rogerperkin.co.uk/ccie/index.php/eem-2/understanding-cisco-eem-event-timer -cron/
您可以为 cron 计时器指定 5 个值
例子:
01 * * * * This command is run at one min past every hour
17 8 * * * This command is run daily at 8:17 am
*/1 **** this command runs every minute