コンフィグレーションガイド Vol.1

[目次][索引][前へ][次へ]


6.3.3 テンプレートの編集

<この項の構成>
(1) テンプレートのコマンド再登録(上書き)
(2) テンプレートのコマンド削除
(3) テンプレートのコマンド挿入
(4) テンプレートのコマンド修正

(1) テンプレートのコマンド再登録(上書き)

テンプレートに登録済みのコマンドとパラメータまで同じコンフィグレーションコマンドを入力した場合,登録済みのコマンドを上書きします。該当するコマンドの既存の登録順が変更になることもありません。

登録済みのコマンドとパラメータの一部が異なるコンフィグレーションコマンドを入力した場合は,別のコマンドとして登録されます。

入力したコマンドがモード遷移するコマンドの場合は,該当するモードに遷移します。また,モード遷移後に入力したコマンドは,そのモード内の最後に新規コマンドとして登録されます。

モードの遷移を伴うコマンドの再登録例を次の図に示します。

図6-40 コマンドの再登録例

(config-TPL)# show
template EtherDEF $PORT
  interface gigabitethernet $PORT
    shutdown
    speed 1000
    no shutdown
  end-template
!
(config-TPL)#
(config-TPL)# interface gigabitethernet $PORT          <-1
(config-if-TPL)# speed auto                            <-2
(config-if-TPL)# exit
(config-TPL)# show 
template EtherDEF $PORT
  interface gigabitethernet $PORT
    shutdown
    speed 1000
    no shutdown
    speed auto                                         <-3
  end-template
!
(config-TPL)#
 
  1. テンプレートに登録済みのギガビットイーサネットのインタフェース$PORTにモードを遷移します。
  2. テンプレートに登録済みのコマンド(speedコマンド)とパラメータが異なるコンフィグレーションコマンドを入力します。
  3. ギガビットイーサネットのインタフェース$PORTの最後に,新規コマンドとして登録されます(登録済みの「speed 1000」に上書きされません)。

(2) テンプレートのコマンド削除

テンプレートに登録済みのコンフィグレーションコマンドを削除する場合はdeleteコマンドを使用します。deleteコマンドの使用例を次の図に示します。

図6-41 deleteコマンドの使用例

(config-TPL)# show
template EtherDEF $PORT 
  interface gigabitethernet $PORT
    shutdown
    speed 1000
    no shutdown
  end-template
!
(config-TPL)#
(config-TPL)# interface gigabitethernet $PORT          <-1
(config-if-TPL)# delete speed 1000                     <-2
(config-if-TPL)# show
template EtherDEF $PORT
  interface gigabitethernet $PORT                      <-3
    shutdown
    no shutdown
  end-template
!
(config-if-TPL)#
 
  1. 削除するコマンドのモードに移行します。
  2. deleteコマンドを使用して,削除するコマンドを入力します。
  3. 「speed 1000」が削除されました。

(3) テンプレートのコマンド挿入

テンプレートの任意の位置にコンフィグレーションコマンドを挿入する場合はinsertコマンドを使用します。insertコマンドの使用例を次の図に示します。

図6-42 insertコマンドの使用例

(config-TPL)# show
template EtherDEF $PORT
  interface gigabitethernet $PORT
    shutdown
    no shutdown                                        <-1
  end-template
!
(config-TPL)#
(config-TPL)# interface gigabitethernet $PORT          <-2
(config-if-TPL)# insert speed 1000                     <-3
(config-if-TPL-INS)# no shutdown                       <-4
(config-if-TPL)# show
template EtherDEF $PORT
  interface gigabitethernet $PORT
    shutdown
    speed 1000                                         <-5
    no shutdown
  end-template
!
(config-if-TPL)#
 
  1. この位置にコマンドを挿入します。
  2. コマンドを挿入するモードに移行します。
  3. insertコマンドを使用して,挿入するコマンドを入力します。
  4. プロンプトの後ろに「-INS」が付きます。ここで,挿入する位置にある「no shutdown」を入力します。
  5. 「no shutdown」の前に「speed 1000」が挿入されました。

(4) テンプレートのコマンド修正

テンプレートに登録済みのコンフィグレーションコマンドやパラメータを修正する場合はreplaceコマンドを使用します。replaceコマンドの使用例を次の図に示します。

図6-43 replaceコマンドの使用例

(config-TPL)# show
template EtherDEF $PORT
  interface gigabitethernet $PORT
    shutdown
    speed 1000                                         <-1
    no shutdown
  end-template
!
(config-TPL)#
(config-TPL)# interface gigabitethernet $PORT          <-2
(config-if-TPL)# replace speed auto                    <-3
(config-if-TPL-REP)# speed 1000                        <-4
(config-if-TPL)# show
template EtherDEF $PORT
  interface gigabitethernet $PORT
    shutdown
    speed auto                                         <-5
    no shutdown
  end-template
!
(config-if-TPL)#
 
  1. speedコマンドのパラメータを1000からautoに変更します。
  2. 変更するコマンドのモードに移行します。
  3. replaceコマンドを使用して,変更後のコマンドを入力します。
  4. プロンプトの後ろに「-REP」が付きます。ここで,変更前のコマンドを入力します。
  5. パラメータが変更されました。

[目次][前へ][次へ]


[他社商品名称に関する表示]

All Rights Reserved, Copyright(C), 2014, 2019, ALAXALA Networks, Corp.