路由器型号:RT-MSR5040-AC-H3
问题:已经设置了nat端口映射,现在想要控制这个nat映射的时间段,比如10:00-11:00可以访问映射资源,其它时间段不能访问,请问要怎么实现?
(0)
您好,请知:
可以配置定时job来满足需求,以下是配置案例,请参考:
一、 组网需求:
对MSR-G2路由器进行配置,在星期一到星期五的上午八点到下午十八点开启Ethernet1/1和Ethernet1/2,其它时间关闭端口,以便起到有效节能的作用。
设备清单:MSR-G2系列路由器1台
二、 组网图:
图1 定时执行任务典型配置组网图
三、 配置步骤:
使用版本:E0006P05
#
scheduler job shutdown-Ethernet1/1 //创建关闭Ethernet1/1的Job
command 1 system-view //执行的第一个命令:进入系统视图
command 2 interface ethernet 1/1 //第二个命令:进入接口E1/1
command 3 shutdown //第三个命令:将接口关闭
#
scheduler job start-Ethernet1/1 //创建开启Ethernet1/1的Job
command 1 system-view
command 2 interface ethernet 1/1
command 3 undo shutdown
#
scheduler job shutdown-Ethernet1/2 //创建关闭Ethernet1/2的Job
command 1 system-view
command 2 interface ethernet 1/2
command 3 shutdown
#
scheduler job start-Ethernet1/2 //创建开启Ethernet1/2的Job
command 1 system-view
command 2 interface ethernet 1/2
command 3 undo shutdown
#
//配置定时执行任务,使MSR-G2在星期一到星期五的上午八点开启pc1、pc2对应的以太网端口
scheduler schedule START-pc1/pc2
job start-Ethernet1/1
job start-Ethernet1/2
time repeating at 8:00 week-day mon tue wed thu fri
#
//配置定时执行任务,使MSR-G2设备在星期一到星期五的下午十八点关闭连接pc1、pc2对应的以太网端口
scheduler schedule STOP-pc1/pc2
job shutdown-Ethernet1/1
job shutdown-Ethernet1/2
time repeating at 18:00 week-day mon tue wed thu fri
#
四、 验证配置:
//显示Job的配置信息
[MSR-G2] display scheduler job
Job name: shutdown-Ethernet1/1
system-view
interface ethernet 1/1
shutdown
Job name: shutdown-Ethernet1/2
system-view
interface ethernet 1/2
shutdown
Job name: start-Ethernet1/1
system-view
interface ethernet 1/1
undo shutdown
Job name: start-Ethernet1/2
system-view
interface ethernet 1/2
undo shutdown
//显示定时任务的运行信息
[MSR-G2] 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-Ethernet1/1 Successful
start-Ethernet1/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-Ethernet1/1 Successful
shutdown-Ethernet1/2 Successful
//显示Job运行的输出信息,被保存在日志中
[MSR-G2] display scheduler logfile
Job name : start-Ethernet1/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 -----------------------------------
< MSR-G2>system-view
System View: return to User View with Ctrl+Z.
[MSR-G2]interface ethernet 1/1
[MSR-G2-Ethernet1/1]undo shutdown
Job name : start-Ethernet1/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 -----------------------------------
< MSR-G2>system-view
System View: return to User View with Ctrl+Z.
[MSR-G2]interface ethernet 1/2.
[MSR-G2-Ethernet1/2]undo shutdown
Job name : shutdown-Ethernet1/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 -----------------------------------
< MSR-G2>system-view
System View: return to User View with Ctrl+Z.
[MSR-G2]interface ethernet 1/1
[MSR-G2]shutdown
Job name : shutdown-Ethernet1/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 -----------------------------------
< MSR-G2>system-view
System View: return to User View with Ctrl+Z.
[MSR-G2]interface ethernet 1/2
[MSR-G2]shutdown
五、 配置关键点:
略
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
通过类似H3C imc等网管下发命令等方式实现吧