H3CNE实验:Comware基本命令操作

第1步:Comware命令视图及切换操作

<H3C>system-view
System View: return to User View with Ctrl+Z.
[H3C]quit
<H3C>system-view
System View: return to User View with Ctrl+Z.
[H3C]interface Olt3/0/1
[H3C-Olt3/0/1]quit
[H3C]vlan 10
[H3C-vlan10]quit
[H3C]ospf
[H3C-ospf-1]qu
[H3C]user-interface vty 0 4
[H3C-ui-vty0-4]return
<H3C>

system-view:从用户视图进入系统视图。

quit:从当前视图放回上一级视图。

interface Olt3/0/1:进入接口视图。
可以看到提示符变为[H3C-Olt3/0/1],表示进入设备对应的接口的接口视图,在接口视图下,可以完成接口下各种参数的设置。

vlan 10:进入vlan视图。
再次视图下提示符变为[H3C-vlan10],表示创建VLAN并进入VLAN视图,在VLAN视图下,可以给VLAN命名并且可以把端口加入相应的VLAN内。

ospf:进入OSPF路由协议视图。

user-interface vty 0 4:进入VTY用户界面视图。
在此视图下提示符变为[H3C-ui-vty0-4],表示进入用户界面视图。在用户界面视图下,可以配置一系列用户登录的参数,如用户登录时是否需要认证、是否重定向到别的设备记忆用户登录后的权限级别等。当用户使用该用户信息登录时,将收到这些参数的约束,从而达到统一管理各种用户回话连接的目的。

return:返回用户视图。

第2步:使用Comware命令的帮助功能

(1) 在任意视图下,键入“?”即可获取该视图下可以使用的所有命令及其简单描述。

<H3C>?
User view commands:
  archive           Specify archive settings
  backup            Backup next startup-configuration file to TFTP server
  boot-loader       Set boot loader
  bootrom           Update/read/backup/restore bootrom
  cd                Change current directory 
  clock             Specify the system clock
  cluster           Run cluster command
  copy              Copy from one file to another 
  debugging         Enable system debugging functions
  delete            Delete a file 
  dir               List files on a file system 
  display           Display current system information
  fixdisk           Recover lost chains in storage device
  format            Format the device
  free              Clear user terminal interface
  ftp               Open FTP connection 
  graceful-restart  Graceful restart
  ipc               Interprocess communication
  lock              Lock current user terminal interface
  logfile           Specify log file configuration
  mkdir             Create a new directory 
  more              Display the contents of a file 
  mount             Mount a device 
  move              Move the file 
  mpls              Configure MPLS (Multiprotocol Label Switching)
  mtracert          Trace route to multicast source
  ntdp              Run NTDP commands
  oap               Open application platform operation
  ping              Ping function 
  pwd               Display current working directory 
  quit              Exit from current command view
  reboot            Reboot system/board/card
  refresh           Do soft reset
  rename            Rename a file or directory 
  reset             Reset operation
  restore           Restore next startup-configuration file from TFTP server 
  rmdir             Remove an existing directory 
  save              Save current configuration
  schedule          Schedule system task
  screen-length     Specify the lines displayed on one screen
  send              Send information to other user terminal interface
  sftp              Establish one SFTP connection 
  ssh2              Establish a secure shell client connection 
  startup           Specify system startup parameters 
  super             Set the current user priority level 
  system-view       Enter the System View
  telnet            Establish one TELNET connection 
  terminal          Set the terminal line characteristics 
  tftp              Open TFTP connection 
  tracert           Trace route function 
  umount            Umount a device 
  undelete          Recover a deleted file 
  undo              Cancel current setting
                
<H3C>

(2)键入一条命令的关键字,后面接空格分割的“?”。如果“?”位置为关键字,则列出全部关键字及其简单描述。

<H3C>terminal ?
  debugging  Send debug information to terminal 
  logging    Send log information to terminal 
  monitor    Send information output to current terminal 
  trapping   Send trap information to terminal 

(3)如果“?”位置为参数,则会列出有关的参数描述。

[H3C]interface Vlan-interface ?
  <1-4094>  VLAN interface number

[H3C]interface Vlan-interface 1 ?
  <cr>  

[H3C]interface Vlan-interface 1 
[H3C-Vlan-interface1]
%Jun 26 19:52:30:954 2017 H3C IFNET/3/LINK_UPDOWN: Vlan-interface1 link status is UP.
%Jun 26 19:52:30:974 2017 H3C IFNET/5/LINEPROTO_UPDOWN: Line protocol on the interface Vlan-interface1 is UP.

”表示命令行当前位置无参数,直接按回车键即可执行。

(4)如果键入命令的不完整关键字,其后紧接“?”,则会显示以该字符串开头的所有命令关键字。

[H3C]f?
   file
   flow-classification
   ftp
   ftth

使用Comware命令的不完整输入和编辑功能

<H3C>sy
System View: return to User View with Ctrl+Z.
[H3C]int O3/0/1
[H3C-Olt3/0/1]qu
[H3C]qu
<H3C>

(1)输入sy可代替system-view的完整命令。
(2)输入int O3/0/1可代替interface Olt3/0/1的完整命令。
(3)也可以按【Tab】键自动补全。

第4步:使用Comware命令的错误提示信息

<H3C>abc
     ^
 % Unrecognized command found at '^' position.
<H3C>display 
             ^
 % Incomplete command found at '^' position.
<H3C>b
     ^
 % Ambiguous command found at '^' position.
<H3C>system-view a
                 ^
 % Too many parameters found at '^' position.
<H3C>display interface Olt3/0/0/1
                       ^
 % Wrong parameter found at '^' position.

(1) % Unrecognized command found at '^' position.:表示在符号“^”指示位置的命令无法解析。
(2) % Incomplete command found at '^' position.:表示在符号“^”指示位置的命令不完整。
(3) % Ambiguous command found at '^' position.:表示在符号“^”指示位置的参数不明确。
(4) % Too many parameters found at '^' position.:表示在符号“^”指示位置输入的参数太多。
(5) % Wrong parameter found at '^' position.:表示在符号“^”指示位置的参数错误。

第5步:使用Comware命令行的历史信息

[H3C]display history-command
  return
  system-view
  interface Vlan-interface 1
  quit
  system-view
  return
  sy
  int O3/0/1
  qu
  system-view

第6步:使用Comware命令行的分屏显示输出

“---- More ----”
……

第7步:掌握H3C设备基本管理命令

<H3C>display clock
20:12:45 UTC Mon 06/26/2017
<H3C>clock datetime ?
  TIME  Specify the time (HH:MM:SS)

<H3C>clock datetime 16:36:00 ?
  DATE  Specify the date from 2000 to 2035 (MM/DD/YYYY or YYYY/MM/DD)

<H3C>clock datetime 16:36:00 2017/06/30
<H3C>display clock
16:36:11 UTC Fri 06/30/2017
<H3C>system-view
System View: return to User View with Ctrl+Z.
[H3C]
[H3C]sysname ?
  TEXT  Host name (1 to 30 characters) 

[H3C]sysname H3C-R1
[H3C-R1]

(1) display clock:显示系统当前的时间和日期。
(2) clock datetime time data:在用户视图下,配置时间和日期。

第8步:熟悉H3C设备的常用查看命令

<H3C-R1>display version
H3C Comware Platform Software
Comware Software, Version 5.20, Release 6616P05
Copyright (c) 2004-2011 Hangzhou H3C Tech. Co., Ltd. All rights reserved.
H3C S7502E uptime is 0 week, 0 day, 1 hour, 32 minutes

MPU(M) 0:
Uptime is 0 weeks,0 days,1 hours,32 minutes
H3C S7502E MPU(M) with 1 BCM1125H Processor
BOARD TYPE:         LSQ1MPUA
DRAM:               512M bytes
FLASH:              64M bytes
NVRAM:              512K bytes
PCB 1 Version:      VER.A
Bootrom Version:    303
CPLD 1 Version:     006
CPLD 2 Version:     006
Release Version:    H3C S7502E-6616P05
Patch Version  :    None

Slot 1 Without Board

Slot 2 Without Board

LPU 3:
Uptime is 0 weeks,0 days,1 hours,31 minutes
H3C S7502E LPU with 1 BCM1122 Processor
BOARD TYPE:         LSQ4PT16PSC
DRAM:               512M bytes
FLASH:              0M bytes
NVRAM:              0K bytes
PCB 1 Version:      VER.A
Bootware Version:   306
CPLD 1 Version:     001
CPLD 2 Version:     001
Release Version:    H3C S7502E-6616P05
Patch Version  :    None
<H3C-R1>
<H3C-R1>display current-configuration
#
 version 5.20, Release 6616P05
#
 sysname H3C-R1
#
 domain default enable system
#
switch-mode standard
switch-mode normal slot 3
#
vlan 1
#
vlan 10
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
user-group system
#
interface NULL0
#               
interface Vlan-interface1
#               
interface GigabitEthernet3/1/1
 port link-mode bridge
#               
interface GigabitEthernet3/1/2
 port link-mode bridge
#               
interface GigabitEthernet3/1/3
 port link-mode bridge
#               
interface GigabitEthernet3/1/4
 port link-mode bridge
#               
interface GigabitEthernet3/1/5
 port link-mode bridge
#               
interface GigabitEthernet3/1/6
 port link-mode bridge
#               
interface GigabitEthernet3/1/7
 port link-mode bridge
#               
interface GigabitEthernet3/1/8
 port link-mode bridge
#               
interface M-Ethernet0/0/0
#               
interface Olt3/0/1
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/2
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/3
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/4
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/5
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/6
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/7
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/8
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/9
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/10
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/11
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/12
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/13
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/14
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/15
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
interface Olt3/0/16
 port link-type hybrid
 port hybrid vlan 1 tagged
#               
ospf 1          
#               
 load xml-configuration
#               
user-interface aux 0
user-interface vty 0 15
#               
return          
<H3C-R1>
<H3C-R1>display diagnostic-information
Save or display diagnostic information (Y=save, N=display)? [Y/N]:y
Please input the file name(*.diag)[flash:/default.diag]:
The file already exists, overwrite it? [Y/N]:y
Diagnostic information is outputting to flash:/default.diag.
Please wait........................
Save successfully.

<H3C-R1>system-view
System View: return to User View with Ctrl+Z.
[H3C-R1]user-interface vty 0 4
[H3C-R1-ui-vty0-4]display this
#
user-interface aux 0
user-interface vty 0 15
#
return
[H3C-R1-ui-vty0-4]return

(1) display version命令显示系统版本信息。

(2) display current-configuration命令显示H3C设备当前生效的配置。

(3) display diagnostic-information命令显示或保存H3C设备系统当前多个功能模块运行的统计信息。

(4) display this命令显示当前视图下生效的配置。

原文地址:https://www.cnblogs.com/xianyue/p/7099902.html