请问H3c 5560交换机定时开启或关闭端口,该如何配置,是否可以配置比如2小时后执行开启或关闭端,请大神指点,谢谢
[XXL-SW2]dis version H3C Comware Software, Version 7.1.070, Release 3506P12 Copyright (c) 2004-2021 New H3C Technologies Co., Ltd. All rights reserved. H3C S5560-54S-EI uptime is 6 weeks, 2 days, 1 hour, 44 minutes
(0)
最佳答案
可以配置调度任务看下,以下是参考命令:
1、配置调度工作
[H3C]scheduler job save //配置调度工作,命名为save
[H3C-job-save]command 1 int gi 1/0/1 //配置调度工作执行的第一个命令,为进入端口
[H3C-job-save]command 2 shutdown //配置调度工作执行的第二个命令,为shutdown
[H3C-job-save]quit
2、配置调度工作的时间
[H3C]scheduler schedule save //配置调度时间,命名为save
[H3C-schedule-save]job save //调用调度工作
[H3C-schedule-save]time repeating at 7:35 //配置定期执行的时间为每天的7:35
[H3C-schedule-save]quit
(0)
您好,可以做job任务,定时执行接口shut/undo shut动作,就能实现需求了,详细操作方法可以参考对应设备的配置手册
使用指导】 使用scheduler schedule命令可以配置定时执行任务,让设备在指定时间执行指定命令。 配置步骤如下: (1) 使用scheduler job命令创建Job。 (2) 在Job视图下,使用command命令配置需要执行的命令。 (3) 使用scheduler schedule命令创建Schedule。 (4) 在Schedule视图下,使用job命令为Schedule分配Job。一个Schedule下可以分配多个Job,但必须是已创建的Job,否则分配失败。 (5) 在Schedule视图下,使用user-role命令为Schedule配置用户角色。一个Schedule下最多可以分配64个角色。 (6) 在Schedule视图下,使用time at、time once或者time repeating命令来配置任务执行的时间。一个Schedule下只能设置一个执行时间。
(0)
暂无评论
job reboot
view monitor(注意,非system视图)
time 1 repeating at 12:57 command reboot
time 2 repeating at 12:57 command y
(0)
暂无评论
对Device进行配置,在星期一到星期五的上午八点到下午十八点开启GigabitEthernet2/0/1和GigabitEthernet2/0/2,其它时间关闭端口,以便起到有效节能的作用。
# 进入系统视图。
# 创建关闭GigabitEthernet2/0/1的Job。
[Sysname] scheduler job shutdown-GigabitEthernet2/0/1
[Sysname-job-shutdown-GigabitEthernet2/0/1] command 1 system-view
[Sysname-job-shutdown-GigabitEthernet2/0/1] command 2 interface gigabitethernet 2/0/1
[Sysname-job-shutdown-GigabitEthernet2/0/1] command 3 shutdown
[Sysname-job-shutdown-GigabitEthernet2/0/1] quit
# 创建开启GigabitEthernet2/0/1的Job。
[Sysname] scheduler job start-GigabitEthernet2/0/1
[Sysname-job-start-GigabitEthernet2/0/1] command 1 system-view
[Sysname-job-start-GigabitEthernet2/0/1] command 2 interface gigabitethernet 2/0/1
[Sysname-job-start-GigabitEthernet2/0/1] command 3 undo shutdown
[Sysname-job-start-GigabitEthernet2/0/1] quit
# 创建关闭GigabitEthernet2/0/2的Job。
[Sysname] scheduler job shutdown-GigabitEthernet2/0/2
[Sysname-job-shutdown-GigabitEthernet2/0/2] command 1 system-view
[Sysname-job-shutdown-GigabitEthernet2/0/2] command 2 interface gigabitethernet 2/0/2
[Sysname-job-shutdown-GigabitEthernet2/0/2] command 3 shutdown
[Sysname-job-shutdown-GigabitEthernet2/0/2] quit
# 创建开启GigabitEthernet2/0/2的Job。
[Sysname] scheduler job start-GigabitEthernet2/0/2
[Sysname-job-start-GigabitEthernet2/0/2] command 1 system-view
[Sysname-job-start-GigabitEthernet2/0/2] command 2 interface gigabitethernet 2/0/2
[Sysname-job-start-GigabitEthernet2/0/2] command 3 undo shutdown
[Sysname-job-start-GigabitEthernet2/0/2] quit
# 配置定时执行任务,使Device在星期一到星期五的上午八点开启pc1、pc2对应的以太网端口。
[Sysname] scheduler schedule START-pc1/pc2
[Sysname-schedule-START-pc1/pc2] job start-GigabitEthernet2/0/1
[Sysname-schedule-START-pc1/pc2] job start-GigabitEthernet2/0/2
[Sysname-schedule-START-pc1/pc2] time repeating at 8:00 week-day mon tue wed thu fri
[Sysname-schedule-START-pc1/pc2] quit
# 配置定时执行任务,使Device在星期一到星期五的下午十八点关闭pc1、pc2对应的以太网端口。
[Sysname] scheduler schedule STOP-pc1/pc2
[Sysname-schedule- STOP-pc1/pc2] job shutdown-GigabitEthernet2/0/1
[Sysname-schedule- STOP-pc1/pc2] job shutdown-GigabitEthernet2/0/2
[Sysname-schedule- STOP-pc1/pc2] time repeating at 18:00 week-day mon tue wed thu fri
[Sysname-schedule- STOP-pc1/pc2] quit
# 显示Job的配置信息。
[Sysname] display scheduler job
Job name: shutdown-GigabitEthernet2/0/1
system-view
interface gigabitethernet 2/0/1
shutdown
Job name: shutdown-GigabitEthernet2/0/2
system-view
interface gigabitethernet 2/0/2
shutdown
Job name: start-GigabitEthernet2/0/1
system-view
interface GigabitEthernet 2/0/1
undo shutdown
Job name: start-GigabitEthernet2/0/2
system-view
interface gigabitethernet 2/0/2
undo shutdown
# 显示定时任务的运行信息。
[Sysname] display scheduler schedule
Schedule name : START-pc1/pc2
Schedule type : Run on every Mon Tue Wed Thu Fri at 08:00:00
Start time : Wed Sep 28 08:00:00 2011
Last execution time : Wed Sep 28 08:00:00 2011
Last completion time : Wed Sep 28 08:00:03 2011
Execution counts : 1
-----------------------------------------------------------------------
Job name Last execution status
start-GigabitEthernet2/0/1 Successful
start-GigabitEthernet2/0/2 Successful
Schedule name : STOP-pc1/pc2
Schedule type : Run on every Mon Tue Wed Thu Fri at 18:00:00
Start time : Wed Sep 28 18:00:00 2011
Last execution time : Wed Sep 28 18:00:00 2011
Last completion time : Wed Sep 28 18:00:01 2011
Execution counts : 1
-----------------------------------------------------------------------
Job name Last execution status
shutdown-GigabitEthernet2/0/1 Successful
shutdown-GigabitEthernet2/0/2 Successful
# 显示Job运行的输出信息。
[Sysname] display scheduler logfile
Job name : start-GigabitEthernet2/0/1
Schedule name : START-pc1/pc2
Execution time : Wed Sep 28 08:00:00 2011
Completion time : Wed Sep 28 08:00:02 2011
--------------------------------- Job output -----------------------------------
<Sysname>system-view
System View: return to User View with Ctrl+Z.
[Sysname]interface gigabitethernet 2/0/1
[Sysname-GigabitEthernet2/0/1]undo shutdown
Job name : start-GigabitEthernet2/0/2
Schedule name : START-pc1/pc2
Execution time : Wed Sep 28 08:00:00 2011
Completion time : Wed Sep 28 08:00:02 2011
--------------------------------- Job output -----------------------------------
<Sysname>system-view
System View: return to User View with Ctrl+Z.
[Sysname]interface gigabitethernet 2/0/2.
[Sysname-GigabitEthernet2/0/2]undo shutdown
Job name : shutdown-GigabitEthernet2/0/1
Schedule name : STOP-pc1/pc2
Execution time : Wed Sep 28 18:00:00 2011
Completion time : Wed Sep 28 18:00:01 2011
--------------------------------- Job output -----------------------------------
<Sysname>system-view
System View: return to User View with Ctrl+Z.
[Sysname]interface gigabitethernet 2/0/1
[Sysname-GigabitEthernet2/0/1]shutdown
Job name : shutdown-GigabitEthernet2/0/2
Schedule name : STOP-pc1/pc2
Execution time : Wed Sep 28 18:00:00 2011
Completion time : Wed Sep 28 18:00:01 2011
--------------------------------- Job output -----------------------------------
<Sysname>system-view
System View: return to User View with Ctrl+Z.
[Sysname]interface gigabitethernet 2/0/2
[Sysname-GigabitEthernet2/0/2]shutdown
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论