H3C SR6608-M Router Configuration Examples All-in-One-R9141-6W100

HomeSupportRoutersSR6600-M SeriesConfigure & DeployConfiguration ExamplesH3C SR6608-M Router Configuration Examples All-in-One-R9141-6W100
Table of Contents
Related Documents
54-Scheduling a Task Configuration Examples
Title Size Download
54-Scheduling a Task Configuration Examples 84.29 KB

 

H3C Routers

Scheduling a Task

Configuration Examples

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2024 New H3C Technologies Co., Ltd. All rights reserved.

No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co., Ltd.

Except for the trademarks of New H3C Technologies Co., Ltd., any trademarks that may be mentioned in this document are the property of their respective owners.

The information in this document is subject to change without notice.



Introduction

The following information provides examples for scheduling a task.

Prerequisites

This document applies to Comware 9-based routers. Procedures and information in the examples might be slightly different depending on the software or hardware version of the router.

The configuration examples in this document were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.

This document assumes that you have basic knowledge of task scheduling.

Example: Scheduling a task

Network configuration

As shown in Figure 1, GigabitEthernet 2/0/1 and GigabitEthernet 2/0/2 on the router are each connected to a host.

Configure the router to perform the following operations:

·     Enable GigabitEthernet 2/0/1 and GigabitEthernet 2/0/2 at 8:00 a.m. every Monday through Friday.

·     Disable GigabitEthernet 2/0/1 and GigabitEthernet 2/0/2 at 18:00 every Monday through Friday.

Figure 1 Network diagram

Software versions used

This configuration example was created and verified on R9141P16 of the SR6608-M device.

Restrictions and guidelines

·     The command line specified by the command command must be a successfully executable command line on the device.

·     The command line specified by the command command cannot be telnet, ftp, ssh2, or monitor process.

·     Before configuring a schedule task, check if the system time is correct. If the system time is incorrect, configure NTP or execute the clock command to ensure that the device gets the accurate time.

Procedures

1.     Configure a job to disable GigabitEthernet 2/0/1.

# Create a job named shutdown-GigabitEthernet 2/0/1 and enter job view.

[Router] scheduler job shutdown-GigabitEthernet2/0/1

# Assign a command to the job to enter system view.

[Router-job-shutdown-GigabitEthernet2/0/1] command 1 system-view

# Assign a command to the job to enter GigabitEthernet 2/0/1 interface view.

[Router-job-shutdown-GigabitEthernet2/0/1] command 2 interface gigabitethernet 2/0/1

# Assign a command to the job to disable GigabitEthernet 2/0/1.

[Router-job-shutdown-GigabitEthernet2/0/1] command 3 shutdown

[Router-job-shutdown-GigabitEthernet2/0/1] quit

2.     Configure a job to disable GigabitEthernet 2/0/2.

# Create a job named shutdown-GigabitEthernet 2/0/2 and enter job view.

[Router] scheduler job shutdown-GigabitEthernet2/0/2

# Assign a command to the job to enter system view.

[Router-job-shutdown-GigabitEthernet2/0/2] command 1 system-view

# Assign a command to the job to enter GigabitEthernet 2/0/2 interface view.

[Router-job-shutdown-GigabitEthernet2/0/2] command 2 interface gigabitethernet 2/0/2

# Assign a command to the job to disable GigabitEthernet 2/0/2 .

[Router-job-shutdown-GigabitEthernet2/0/2] command 3 shutdown

[Router-job-shutdown-GigabitEthernet2/0/2] quit

3.     Configure a job to enable GigabitEthernet 2/0/1.

# Create a job named start-GigabitEthernet 2/0/1 and enter job view.

[Router] scheduler job start-GigabitEthernet2/0/1

# Assign a command to the job to enter system view.

[Router-job-start-GigabitEthernet2/0/1] command 1 system-view

# Assign a command to the job to enter GigabitEthernet 2/0/1 interface view.

[Router-job-start-GigabitEthernet2/0/1] command 2 interface gigabitethernet 2/0/1

# Assign a command to the job to enable GigabitEthernet 2/0/1.

[Router-job-start-GigabitEthernet2/0/1] command 3 undo shutdown

[Router-job-start-GigabitEthernet2/0/1] quit

4.     Configure a job to enable GigabitEthernet 2/0/2.

# Create a job named start-GigabitEthernet 2/0/2 and enter job view.

[Router] scheduler job start-GigabitEthernet2/0/2

# Assign a command to the job to enter system view.

[Router-job-start-GigabitEthernet2/0/2] command 1 system-view

# Assign a command to the job to enter GigabitEthernet 2/0/2 interface view.

[Router-job-start-GigabitEthernet2/0/2] command 2 interface gigabitethernet 2/0/2

# Assign a command to the job to enable GigabitEthernet 2/0/2 .

[Router-job-start-GigabitEthernet2/0/2] command 3 undo shutdown

[Router-job-start-GigabitEthernet2/0/2] quit

5.     Configure a schedule to enable GigabitEthernet 2/0/1 and GigabitEthernet 2/0/2 at 8:00 a.m. every Monday through Friday.

# Create a schedule named connect-host1/host2 and enter schedule view.

[Router] scheduler schedule connect-host1/host2

# Assign the job named start-GigabitEthernet 2/0/1 to the schedule.

[Router-schedule-connect-host1/host2] job start-GigabitEthernet2/0/1

# Assign the job named start-GigabitEthernet 2/0/2 to the schedule.

[Router-schedule-connect-host1/host2] job start-GigabitEthernet2/0/2

# Configure the device to execute the schedule at 8:00 a.m. every Monday through Friday.

[Router-schedule-connect-host1/host2] time repeating at 08:00 week-day Mon Tue Wed Thu Fri

[Router-schedule-connect-host1/host2] quit

6.     Configure a schedule to disable GigabitEthernet 2/0/1 and GigabitEthernet 2/0/2 at 18:00 every Monday through Friday.

# Create a schedule named unconnect-host1/host2 and enter schedule view.

[Router] scheduler schedule unconnect-host1/host2

# Assign the job named shutdown-GigabitEthernet 2/0/1 to the schedule.

[Router-schedule-unconnect-host1/host2] job shutdown-GigabitEthernet2/0/1

# Assign the job named shutdown-GigabitEthernet 2/0/2 to the schedule.

[Router-schedule-unconnect-host1/host2] job shutdown-GigabitEthernet2/0/2

# Configure the device to execute the schedule at 18:00 every Monday through Friday.

[Router-schedule-unconnect-host1/host2] time repeating at 18:00 week-day Mon Tue Wed Thu Fri

[Router-schedule-unconnect-host1/host2] quit

Verifying the configuration

# Use display scheduler job to display the configuration information of all jobs.

<Router> display scheduler job

Job name: shutdown-GigabitEthernet2/0/1

 system-view

 interface GigabitEthernet2/0/1

 shutdown

 

Job name: shutdown-GigabitEthernet2/0/2

 system-view

 interface GigabitEthernet2/0/2

 shutdown

 

Job name: start-GigabitEthernet2/0/1

 system-view

 interface GigabitEthernet2/0/1

 undo shutdown

 

Job name: start-GigabitEthernet2/0/2

 system-view

 interface GigabitEthernet2/0/2

 undo shutdown

# Use display scheduler schedule to display the schedule information.

<Router> display scheduler schedule

Schedule name        : connect-host1/host2

Schedule type        : Run on every Mon Tue Wed Thu Fri at 08:00:00

Start time           : Thu Nov 14 08:00:00 2013

Last execution time  : Yet to be executed

-----------------------------------------------------------------------

Job name                                          Last execution status

start-GigabitEthernet2/0/1                        -NA-

start-GigabitEthernet2/0/2                        -NA-

 

Schedule name        : unconnect-host1/host2

Schedule type        : Run on every Mon Tue Wed Thu Fri at 18:00:00

Start time           : Wed Nov 13 18:00:00 2013

Last execution time  : Yet to be executed

-----------------------------------------------------------------------

Job name                                          Last execution status

shutdown-GigabitEthernet2/0/1                     -NA-

shutdown-GigabitEthernet2/0/2                     -NA-

# Use display ip interface brief to view the status of Layer 3 interfaces at 7:59 a.m.

[Router] display ip interface brief

*down: administratively down

(s): spoofing  (l): loopback

Interface                Physical Protocol IP Address      Description

Ana3/0                   down     down     --              --

Aux0                     up       down     --              --

GE0/0/0                  up       up       192.168.100.67  --

GE2/0/1                  *down    down     --              --

GE2/0/2                         *down    down     --              --

# At 8:00 a.m., the following log information is displayed:

%Apr 22 08:00:10:245 2014 Router IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet2/0/1 changed to up.

%Apr 22 08:00:10:245 2014 Router IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet2/0/1 changed to up.

%Apr 22 08:00:10:250 2014 Router IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet2/0/2 changed to up.

%Apr 22 08:00:10:250 2014 Router IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet2/0/2 changed to up.

# Use display ip interface brief to view the status of Layer 3 interfaces at 8:00 a.m.

[Router] display ip interface brief

*down: administratively down

(s): spoofing  (l): loopback

Interface                Physical Protocol IP Address      Description

Ana3/0                   down     down     --              --

Aux0                     up       down     --              --

GE0/0/0                  up       up       192.168.100.67  --

GE2/0/1                  up       up       --              --

GE2/0/2                         up       up       --              --

# At 18:00 p.m., the following log information is displayed:

%Apr 22 18:00:06:250 2014 Router IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet2/0/1 changed to down.

%Apr 22 18:00:06:250 2014 Router IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet2/0/1 changed to down.

%Apr 22 18:00:06:256 2014 Router IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet2/0/2 changed to down.

%Apr 22 18:00:06:256 2014 Router IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet2/0/2 changed to down.

# Use display ip interface brief to view the status of Layer 3 interfaces at 18:00 p.m.

[Router] display ip interface brief

*down: administratively down

(s): spoofing  (l): loopback

Interface                Physical Protocol IP Address      Description

Ana3/0                   down     down     --              --

Aux0                     up       down     --              --

GE0/0                    up       up       192.168.100.67  --

GE2/0/1                  *down    down     --              --

GE2/0/2                         *down    down     --              --

Configuration files

#

scheduler job shutdown-GigabitEthernet2/0/1

 command 1 system-view

 command 2 interface gigabitethernet1/0/1

 command 3 shutdown

#

scheduler job shutdown-GigabitEthernet2/0/2

 command 1 system-view

 command 2 interface gigabitethernet1/0/2

 command 3 shutdown

#

scheduler job start-GigabitEthernet2/0/1

 command 1 system-view

 command 2 interface gigabitethernet1/0/1

 command 3 undo shutdown

#

scheduler job start-GigabitEthernet2/0/2

 command 1 system-view

 command 2 interface gigabitethernet1/0/2

 command 3 undo shutdown

#

scheduler schedule connect-host1/host2

 job start-GigabitEthernet2/0/1

 job start-GigabitEthernet2/0/2

 time repeating at 08:00 week-day Mon Tue Wed Thu Fri

#

scheduler schedule unconnect-host1/host2

 job shutdown-GigabitEthernet2/0/1

 job shutdown-GigabitEthernet2/0/2

 time repeating at 18:00 week-day Mon Tue Wed Thu Fri

#

Related documentation

·     System Management Configuration Guide in H3C SR6608-M Router Configuration Guides(V9)

·     System Management Command Reference in H3C SR6608-M Router Command References(V9)

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网