第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命令顯示當前視圖下生效的配置。