スイッチ プロンプトの概要
(注) インストレーション手順および接続手順については、『Cisco MDS 9200 Series Hardware Installation Guide』または『Cisco MDS 9500 Series Hardware Installation Guide』を参照してください。
スイッチが正常に起動された場合、デフォルトのスイッチ プロンプト( switch#
)が表示されます(例1-1を参照)。
例1-1 スイッチ起動時の出力
Auto booting bootflash:/boot-279 bootflash:/system_image;...
Booting kickstart image:bootflash:/boot-279....
............................................Image verification OK
INIT: version 2.78 booting
Checking all filesystems..... done.
Uncompressing system image: bootflash:/system_image
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
INIT: Entering runlevel: 3
<<<<<<SAN OS bootup log messages>>>>>>
---- Basic System Configuration Dialog ----
This setup utility will guide you through the basic configuration of
the system. Use ctrl-c to abort configuration dialog at any prompt.
Basic management setup configures only enough connectivity for
management of the system.
Would you like to enter the basic configuration dialog (yes/no): yes
<<<<<<after configuration>>>>>>
Cisco Storage Area Networking Operating System (SAN-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (c) 2002-2004, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
Andiamo Systems, Inc. and/or other third parties and are used and
distributed under license. Some parts of this software are covered
under the GNU Public License. A copy of the license is available
at http://www.gnu.org/licenses/gpl.html.
このプロンプトで、組み込みの CLI 動作を実行したり、コマンド ヒストリにアクセスしたり、コマンド解析機能を使用したりできます。 Enter (CR)キーを押すと、スイッチはコマンド ストリングを回収し、端末からコマンドを受け入れます。
CLI コマンド モードの概要
Cisco MDS 9000 ファミリー スイッチには、2 つの主要なコマンド モード(ユーザ EXEC モードおよびコンフィギュレーション モード)があります。どのコマンドを使用できるかは、その時点で有効になっているモードによって決まります。システム プロンプトに疑問符(?)を入力することによって、そのモードで使用可能なコマンドの一覧を表示できます。
表1-1 に、代表的な2つのモード、各モードの開始方法、および表示されるシステム プロンプトを示します。現在どのモードが有効になっていて、どのコマンドが使用可能であるかは、システム プロンプトから判断することができます。
表1-1 よく使用するスイッチ コマンド モード
|
|
|
|
EXEC |
端末設定を一時的に変更したり、基本的なテストを実行したり、システム情報を表示できます。
(注) 通常このモードで行った変更は、システムのリセット時には保存されません。
|
スイッチ プロンプトに、必要なEXECモード コマンドを入力します。 |
|
コンフィギュレーション モード |
システム全体に影響する機能の設定を行うことができます。
(注) このモードで行った変更は、コンフィギュレーションを保存するとシステムをリセットしても保持されます。
|
EXECモードから、 config terminal コマンドを入力します。 |
|
特定のコマンドを他のコマンドから区別できる最低限の文字数だけを入力して、コマンドおよびキーワードを簡略化することができます。たとえば、 config terminal コマンドは、 conf t に簡略化できます。
CLI コマンド階層構造の概要
CLIコマンドは、同じような機能を実行するコマンドを同じレベルに集めた階層構造に編成されています。 たとえば、システム、コンフィギュレーション、またはハードウェアに関する情報を表示するコマンドは、すべて show コマンドのグループに属し、スイッチを設定するコマンドは config terminal コマンドのグループに属します。
コマンドを実行するには、そのコマンドを階層構造のトップ レベルから順に入力します。たとえば、ファイバ チャネル インターフェイスを設定するには、まず config terminal コマンドを使用します。コンフィギュレーション モードを開始してから、 interface コマンドを発行します。インターフェイス サブモードに入った段階で、そのサブモードで使用できるコマンドを調べることができます。
次に、インターフェイス サブモードで使用できるコマンドを確認する例を示します。
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface fc1/1
Interface configuration commands:
channel-group Add to/remove from a port-channel
exit Exit from this submode
fcdomain Enter the interface submode
fspf To configure FSPF related parameters
no Negate a command or set its defaults
shutdown Enable/disable an interface
switchport Configure switchport parameters
EXEC モード オプション
スイッチ上でセッションを開始する場合、最初はEXECモードから始めます。 ユーザに割り当てられている役割またはグループに応じて、一部のコマンドしかアクセスできない場合もあれば、すべてのコマンドにアクセスできる場合もあります。このEXECモードから、コンフィギュレーション モードを開始できます。大部分のEXECコマンドは、 show コマンド(現在のコンフィギュレーション ステータスを表示する)のように、1回限りのコマンドです。次に、EXECモード コマンドの一覧を示します。
attach Connect to a specific linecard
callhome Callhome commands
cd Change current directory
clock Manage the system clock
config Enter configuration mode
copy Copy from one file to another
debug Debugging functions
dir Directory listing for files
discover Discover information
fctrace Trace the route for an N-Port.
find Find a file below the current directory
mkdir Create new directory
no Disable debugging functions
purge Deletes unused data
pwd View current directory
reload Reboot the entire box
rmdir Remove existing directory
run-script Run shell scripts
send Send message to all the open sessions
setup Run the basic SETUP command facility
show Show running system information
sleep Sleep for the specified number of seconds
system System management commands
tail Display the last part of a file
telnet Telnet to another system
terminal Set terminal line parameters
traceroute Trace route to destination
undebug Disable Debugging functions (See also debug)
write Write current configuration
zone Execute Zone Server commands
コンフィギュレーション モード
コンフィギュレーション モードでは、既存のコンフィギュレーションを変更できます。コンフィギュレーションを保存する場合、これらのコマンドはスイッチを再起動しても保持されます。コンフィギュレーション モードから、インターフェイス コンフィギュレーション モード、ゾーン コンフィギュレーション モード、および各種のプロトコル固有モードを開始できます。コンフィギュレーション モードは、あらゆるコンフィギュレーション コマンドの起点です。コンフィギュレーション モードでは、スイッチはユーザからのコンフィギュレーション コマンドを受け付けます。
次に、 config terminal コマンドの出力例を示します。
Enter configuration commands, one per line. End with CNTL/Z.
コンフィギュレーション モードのコマンドおよびサブモード
次に、コンフィギュレーション モード コマンドの一覧を示します。
Enter configuration commands, one per line. End with CNTL/Z.
arp [no] remove an entry from the ARP cache
boot Configure boot variables
callhome Enter the callhome configuration mode
clock Configure time-of-day clock
end Exit from configure mode
exit Exit from configure mode
fcalias Fcalias configuration commands
fcanalyzer Configure cisco fabric analyzer
fcc Configure FC Congestion Control
fcdomain Enter the fcdomain configuration mode
fcdroplatency Configure switch or network latency
fcinterop Interop commands.
fcns Name server configuration
fcroute Configure FC routes
fcs Configure Fabric Config Server
fctimer Configure fibre channel timers
in-order-guarantee Set in-order delivery guarantee
interface Select an interface to configure
line Configure a terminal line
logging Modify message logging facilities
no Negate a command or set its defaults
power Configure power supply
poweroff Poweroff a module in the switch
qos Configure priority of FC control frames
radius-server Configure RADIUS related parameters
rscn Config commands for RSCN
snmp-server Configure snmp server
span Enter SPAN configuration mode
ssh Configure SSH parameters
switchname Configure system's network name
system System config command
trunk Configure Switch wide trunk protocol
username Configure user information.
vsan Enter the vsan configuration mode
wwn Set secondary base MAC addr and range for additional WWNs
zone Zone configuration commands
zoneset Zoneset configuration commands
コンフィギュレーション モード(別名、端末コンフィギュレーション モード)には、いくつかのサブモードがあります。これらのサブモードはそれぞれ、プロンプト階層構造におけるその次のレベルに相当します。 exit を入力すると、1 つ前のレベルに戻ることができます。 end を入力すると、ユーザ EXEC レベルに戻ります。
(注) コンフィギュレーション モードでは、コマンドの代わりに次のキー操作をしても同じ結果となります。
-- end コマンドの代わりに Ctrl+Z
-- exit コマンドの代わりにCtrl+G
コンフィギュレーション モードまたはサブモードのプロンプトから、EXEC モードのコマンドを実行することができます。このコマンドは、コンフィギュレーション モードのすべてのサブモードから発行できます。コンフィギュレーション モード(またはいずれかのサブモード)で、 do コマンドと一緒に必要な EXEC モード コマンドを入力します。入力したコマンドが EXEC レベルで実行され、現在のモード レベルのプロンプトが再び表示されます。
switch(config)#
do terminal session-timeout 0
この例では、 terminal session-timeout は EXEC モード コマンドです。コンフィギュレーション モードの do コマンドを使用して、EXEC モード コマンドを発行しています。
do コマンドは、 end および exit コマンドを除くすべての EXEC モード コマンドに適用できます。また、 do コマンドと一緒に EXEC コマンドを使用するとき、EXEC コマンドのヘルプ( ? )およびコマンド完成( Tab )機能を利用することもできます。
表1-2 に、EXEC モードおよびコンフィギュレーション モードの両方で使用できる便利なコマンド キーを示します。
表1-2 便利なコマンド キー
|
|
Ctrl-P |
ヒストリを上へ |
Ctrl-N |
ヒストリを下へ |
Ctrl-R |
現在の行をリフレッシュし、再表示します。 |
Ctrl-X-H |
ヒストリの一覧表示 |
Alt-P |
ヒストリを後方へ検索
(注) Tab キーによるコマンドの完成機能と Alt+P または Alt+N の違いは、Tab が現在のワードを完成させるのに対し、Alt+P および Alt+N は前に入力したコマンドを完成させる点です。
|
Alt-N |
ヒストリを前方へ検索 |
Ctrl-G |
exit コマンドと同じ |
Ctrl-Z |
end コマンドと同じ |
Ctrl-L |
スクリーンをクリア |
一般的なコンフィギュレーション サブモードを 表1-3 に示します。
表1-3 コンフィギュレーション モードでのサブモード
|
|
|
|
コール ホーム |
callhome |
switch(config-callhome)# |
連絡先、宛先、電子メール |
FCS 登録 |
fcs register |
switch(config-fcs-register)# |
FCS 属性登録 |
FCS 登録サブモードで入力するコマンド: platform name name vsan vsan-id |
switch(config-fcs-register- attrib)# |
プラットフォーム名と VSAN ID との関係 |
ファイバ チャネル エイリアス |
fcalias name name vsan vsan-id |
switch(config-fcalias)# |
エイリアス メンバー |
FSPF |
fspf config vsan vsan-id |
switch(config-(fspf-config))# |
スタティック SPF 計算、保持時間、自律リージョン |
インターフェイス コンフィギュレーション |
interface type slot / port |
switch(config-if)# |
チャネル グループ、ファイバ チャネル ドメイン、FSPF パラメータ、スイッチ ポート トランクおよびビーコン情報、IP アドレス |
VSAN または mgmt0(管理)インターフェイス コンフィギュレーション サブモードから入力するコマンド: vrrp number |
switch(config-if-vrrp)# |
仮想ルータ |
ライン コンソール |
line console |
switch(config-console)# |
プライマリ端末コンソール |
VTY |
line vty |
switch(config-line)# |
仮想端末回線 |
役割 |
role name |
switch(config-role)# |
役割 |
SPAN |
span session number |
switch(config-span)# |
SPAN ソース、宛先、一時停止セッションに関する情報 |
VSAN データベース |
vsan database |
switch(config-vsan-db)# |
VSAN データベース |
ゾーン |
zone name string vsan vsan-id |
switch(config-zone)# |
ゾーン メンバー |
ゾーン セット |
zoneset name name vsan vsan-id |
switch(config-zoneset)# |
ゾーン セット メンバー |