Smartport コマンド

この章は、次の項で構成されています。

macro auto(グローバル)

macro auto グローバル コンフィギュレーション モード コマンドは、Auto Smartport のグローバル管理状態を設定します。デフォルト値に戻すには、このコマンドの no 形式を使用します。

構文

macro auto {enabled | disabled | controlled}

no macro auto

パラメータ

  • enabled:Auto Smartport のグローバル管理状態および動作状態が有効になります。

  • disabled:Auto Smartport のグローバル管理状態および動作状態が無効になります。

  • controlled:自動音声 VLAN の動作時に、Auto Smartport のグローバル管理状態および動作状態が有効になります。

デフォルト設定

管理状態は無効です

コマンド モード

グローバル コンフィギュレーション モード

使用上のガイドライン

Auto Smartport の状態にかかわらず、Smartport マクロを関連付けられた Smartport タイプにいつでも手動で適用できます。Smartport マクロは、組み込みマクロまたはユーザ定義マクロです。「マクロ コマンド」セクションに示されている CLI コマンドを使用して、マクロを定義し、適用することができます。

Auto Smartport の管理状態が制御されている場合、Auto Smartport の動作状態は音声 VLAN マネージャによって管理され、次のように設定されます。

  • OUI 音声 VLAN が有効になっている場合、Auto Smartport の動作状態は無効になります。

    自動音声 VLAN が有効になっている場合、Auto Smartport の動作状態は有効になります。

OUI 音声 VLAN が有効になっている場合、ユーザは Auto Smartport をグローバルに有効にすることはできません。

この例では、controlled モードで Auto Smartport 機能をグローバルに有効にしようとしています。OUI 音声機能が有効になっているため、これはできません。その後、音声 VLAN 状態が無効になり、Auto Smartport を有効にできるようになります。これらの VLAN 上で Auto Smartport 用のポートが設定されているため、適切な VLAN が自動的に有効になります。

switchxxxxxx(config)# macro auto controlled
switchxxxxxx(config)# macro auto enabled
Auto smartports cannot be enabled because OUI voice is enabled.
switchxxxxxx(config)# voice vlan state disabled
switchxxxxxx(config)# macro auto enabled
switchxxxxxx(config)#
10-Apr-2011 16:11:31 %LINK-I-Up:  Vlan 20
10-Apr-2011 16:11:33 %LINK-I-Up:  Vlan 5
10-Apr-2011 16:11:33 %LINK-I-Up:  Vlan 6
10-Apr-2011 16:11:33 %LINK-I-Up:  Vlan 7
10-Apr-2011 16:11:33 %LINK-I-Up:  Vlan 8
10-Apr-2011 16:11:33 %LINK-I-Up:  Vlan 9
10-Apr-2011 16:11:33 %LINK-I-Up:  Vlan 10

macro auto built-in parameters

macro auto built-in parameters グローバル コンフィギュレーション モード コマンドは、組み込み Smartport マクロのデフォルトの Auto Smartport の値を置き換えます。このコマンドの no 形式を使用すると、デフォルト値に戻ります。

構文

macro auto built-in parameters smartport-type [parameter-name value [parameter-name value [parameter-name value]]]

no macro auto built-in parameters smartport-type

パラメータ

  • smartport-type:Smartport タイプ(範囲:printerdesktopguestserverhostip_cameraip_phoneip_phone_desktopswitchrouter、または ap(ワイヤレス アクセス ポイント))。

  • parameter-name value:パラメータ名とその値を指定します。これらは、macro auto user smartport macro コマンドで定義された組み込みマクロまたはユーザ定義マクロのパラメータです

デフォルト設定

組み込み Smartport マクロのパラメータ $native_vlan のデフォルト値は 1 です。

その他のパラメータのデフォルト値は、パラメータのデフォルト値です。たとえば、パラメータがネイティブ VLAN の場合、デフォルト値はデフォルトのネイティブ VLAN です。

コマンド モード

グローバル コンフィギュレーション モード

使用上のガイドライン

デフォルトでは、各 Smartport タイプは組み込みマクロのペアに関連付けられています。これは、設定を適用するマクロと、設定を削除するアンチマクロ(no 形式のマクロ)のペアです。Smartport タイプは対応する組み込み Smartport マクロの名前と同じで、アンチマクロには no_ のプレフィックスが付いています。

パラメータ $voice_vlan の値は、このコマンドでは変更できません。

組み込みマクロのパラメータを変更するには、次のようにします。

switchxxxxxx(config)# macro auto built-in parameters switch $native_vlan 2

macro auto persistent

macro auto persistent インターフェイス コンフィギュレーション モード コマンドは、インターフェイスを Smartport の永続インターフェイスとして設定します。このコマンドの no 形式を使用すると、デフォルトに戻ります。

構文

macro auto persistent

no macro auto persistent

パラメータ

このコマンドには、パラメータやキーワードはありません。

デフォルト設定

Persistent は設定されています。

コマンド モード

インターフェイス(イーサネット、ポート チャネル)コンフィギュレーション モード

使用上のガイドライン

Smartport の永続インターフェイスは、リンク ダウン/アップ、接続デバイスのエージ アウト、および再起動が行われた場合に、その動的設定を保持します。永続化と Smartport 設定を再起動後も有効にするには、実行コンフィギュレーション ファイルをスタートアップ コンフィギュレーション ファイルに保存する必要があります。

この例では、2 つのポート範囲を確立して、片方は永続化し、もう片方は永続化しません。

switchxxxxxx(config)# interface range gi1/0/1-2
switchxxxxxx(config-if-range)# macro auto persistent
switchxxxxxx(config-if-range)# exit
switchxxxxxx(config)# interface range gi1/0/3-4
switchxxxxxx(config-if-range)# no macro auto persistent

macro auto processing cdp

macro auto processing cdp グローバル コンフィギュレーション モード コマンドを使用すると、CDP 機能情報を使用して接続デバイスのタイプを識別できます。

Auto Smartport がインターフェイスで有効になっており、このコマンドが実行されると、接続デバイスがアドバタイズする CDP 機能に基づいて、スイッチは自動的に対応する Smartport タイプをインターフェイスに適用します。

機能を無効にするには、このコマンドの no 形式を使用します。

構文

macro auto processing cdp

no macro auto processing cdp

パラメータ

このコマンドには、パラメータやキーワードはありません。

デフォルト設定

有効

コマンド モード

グローバル コンフィギュレーション モード

次の例では、CDP をグローバルに有効にします。

switchxxxxxx(config)# macro auto processing cdp

macro auto processing lldp

macro auto processing lldp グローバル コンフィギュレーション モード コマンドを使用すると、LLDP 機能情報を使用して接続デバイスのタイプを識別できます。

インターフェイス上で Auto Smartport が有効になっている場合にこのコマンドが実行されると、スイッチは接続デバイスによってアドバタイズされた LLDP 機能に基づいて、対応する Smartport タイプをインターフェイスに自動的に適用します。

機能を無効にするには、このコマンドの no 形式を使用します。

構文

macro auto processing lldp

no macro auto processing lldp

パラメータ

このコマンドには、パラメータやキーワードはありません。

デフォルト設定

有効

コマンド モード

グローバル コンフィギュレーション モード

LLDP をグローバルに有効にする場合:

switchxxxxxx(config)# macro auto processing lldp

macro auto processing type

macro auto processing type グローバル コンフィギュレーション モード コマンドは、指定されたタイプのデバイスの自動検出を有効または無効にします。コマンドの no 形式を使用すると、デフォルトに戻ります。

構文

macro auto processing type smartport-type {enabled | disabled}

no macro auto processing type smartport-type

パラメータ

  • smartport-type:Smartport タイプ(範囲:hostip_phoneip_phone_desktopswitchrouter、または ap(ワイヤレス アクセス ポイント))。

デフォルト設定

デフォルトでは、ip_phone、ip_phone_desktop、switch、および ap(ワイヤレス アクセス ポイント)の自動検出が有効になっています。

コマンド モード

グローバル コンフィギュレーション モード

この例では、ap(ワイヤレス アクセス ポイント)の自動検出が有効になっています。

switchxxxxxx(config)# macro auto processing type ?
  host                 set type to host
  ip_phone             set type to ip_phone
  ip_phone_desktop     set type to ip_phone_desktop
  switch               set type to switch
  router               set type to router
  ap                   set type to access point
switchxxxxxx(config)# macro auto processing type ap enabled

macro auto resume

macro auto resume インターフェイス コンフィギュレーション モード コマンドは、Smartport タイプを unknown から default に変更し、指定したインターフェイスで Smartport 機能を再開します(ただし、Smartport マクロを再適用しません。これを実行するには macro auto trunk refresh コマンドを使用します)。

構文

macro auto resume

パラメータ

このコマンドには、パラメータやキーワードはありません。

デフォルト設定

なし

コマンド モード

インターフェイス(イーサネット、ポート チャネル)コンフィギュレーション モード

使用上のガイドライン

インターフェイスで Smartport マクロが失敗すると、インターフェイスの Smartport タイプが Unknown になります。インターフェイスや Smartport マクロでの失敗の理由を診断し、エラーを修正する必要があります。

Smartport タイプを unknown から default に変更し、ポート 1 の Smartport 機能を再開します。

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# macro auto resume

macro auto smartport(インターフェイス)

macro auto smartport インターフェイス コンフィギュレーション モード コマンドは、指定されたインターフェイスで Auto Smartport 機能を有効にします。このコマンドの no 形式を使用すると、インターフェイスでこの機能が無効化されます。

構文

macro auto smartport

no macro auto smartport

パラメータ

このコマンドには、パラメータやキーワードはありません。

デフォルト設定

有効

コマンド モード

インターフェイス(イーサネット、ポート チャネル)コンフィギュレーション モード

使用上のガイドライン

このコマンドは、Auto Smartport がグローバルに有効になっている場合にのみ有効です。

ポート 1 の Auto Smartport 機能を有効にします。

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# macro auto smartport

macro auto smartport type

macro auto smartport type インターフェイス コンフィギュレーション モード コマンドは、Smartport タイプをインターフェイスに手動で(静的に)割り当てます。このコマンドの no 形式を使用すると、手動で設定したタイプが削除され、default に戻ります。

構文

macro auto smartport type smartport-type [parameter-name value [parameter-name value [parameter-name value]]]

no macro auto smartport type

パラメータ

  • smartport-type:Smartport タイプ。

  • parameter-name value:パラメータ名とその値を指定します(範囲:printer、desktop、guest、server、host、ip_camera、ip_phone、ip_phone_desktop、switch、router、または ap(ワイヤレス アクセス ポイント))

デフォルト設定

parameter-name value:パラメータのデフォルト値。たとえば、パラメータが音声 VLAN の場合、デフォルト値はデフォルトの音声 VLAN です。

コマンド モード

インターフェイス(イーサネット、ポート チャネル)コンフィギュレーション モード

使用上のガイドライン

このコマンドにより設定された静的タイプは、動的タイプにより変更できません。

この例では、ポート 1 の Smartport タイプを printer(静的)に設定しようとしています。このマクロは行 10 で失敗します。

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# macro auto smartport type printer
30-May-2011 15:02:45 %AUTOSMARTPORT-E-FAILEDMACRO: Macro printer for auto smar
port type Printer on interface gi1/0/1 failed at command number 10
switchxxxxxx(config-if)# exit
switchxxxxxx(config)# do show parser macro name printer
Macro name : printer
Macro type : default interface
  1. #macro description printer
  2. #macro keywords $native_vlan
  3. #
  4. #macro key description:  $native_vlan: The untag VLAN which will be configu
red on the port
  5. #Default Values are
  6. #$native_vlan = Default VLAN
  7. #
  8. #the port type cannot be detected automatically
  9. #
 10. switchport mode access
 11. switchport access vlan $native_vlan
 12. #
 13. #single host
 14. port security max 1
 15. port security mode max-addresses
 16. port security discard trap 60
 17. #
 18. smartport storm-control broadcast level 10
 19. smartport storm-control include-multicast
 20. smartport storm-control broadcast enable
switchxxxxxx(config)#

macro auto trunk refresh

macro auto trunk refresh グローバル コンフィギュレーション コマンドは、指定したインターフェイスまたは指定した Smartport タイプのすべてのインターフェイスに Smartport マクロを再適用します。

構文

macro auto trunk refresh [smartport-type] [interface-id]

パラメータ

  • smartport-type:Smartport タイプ(switchrouterap(ワイヤレス アクセス ポイント))。

  • interface-id:インターフェイス識別子(ポートまたはポート チャネル)。

デフォルト設定

ユーザ ガイドラインを参照してください。

コマンド モード

グローバル コンフィギュレーション モード

使用上のガイドライン

macro auto smartport コマンドは、Auto Smartport がグローバルに有効になっている場合にのみ有効になります。

smartport-typeinterface-id の両方が定義されている場合、アタッチされた Smartport マクロは、指定された Smartport タイプを持つインターフェイスで実行されます。

smartport-type のみが定義されている場合、アタッチされた Smartport マクロは、指定された Smartport タイプを持つすべてのインターフェイスで実行されます。

interface-id のみが定義されている場合、インターフェイスが switchrouter、または ap(ワイヤレス アクセス ポイント)の Smartport タイプを持つ場合は、対応するアタッチされた Smartport マクロが実行されます。

Smartport マクロに、1 台以上のインターフェイスで最新ではなくなったコンフィギュレーション コマンドが含まれている場合は、インターフェイスに Smartport マクロを再適用して設定を更新できます。

関連付けられた Smartport マクロを実行して、Smartport タイプ switch のポートを既存のすべての VLAN に追加します。

switchxxxxxx(config)# macro auto trunk refresh switch

macro auto user smartport macro

macro auto user smartport macro グローバル コンフィギュレーション モード コマンドは、ユーザ定義の Smartport マクロを Smartport タイプにリンクします。これは、組み込みマクロへのリンクをユーザ定義マクロへのリンクに置き換えることにより行われます。このコマンドの no 形式を使用すると、リンクがデフォルトの組み込み Smartport マクロに戻ります。

構文

macro auto user smartport macro smartport-type user-defined-macro-name [parameter-name value [parameter-name value [parameter-name value]]]

no macro auto user smartport macro smartport-type

パラメータ

  • smartport-type:Smartport タイプ(範囲:printerdesktopguestserverhostip_cameraip_phoneip_phone_desktopswitchrouter、または ap(ワイヤレス アクセス ポイント))。

  • user-defined-macro-name:組み込み Smartport マクロを置き換えるユーザ定義マクロ名を指定します。

  • parameter-name value:ユーザ定義のマクロのパラメータ名とその値を指定します。

デフォルト設定

parameter-name value:パラメータのデフォルト値。たとえば、パラメータがネイティブ VLAN の場合、デフォルト値はデフォルトのネイティブ VLAN です。

コマンド モード

グローバル コンフィギュレーション モード

使用上のガイドライン

各パラメータの対象範囲は、定義されているマクロです。パラメータ $voice_vlan は例外で、グローバル パラメータであり、その値はスイッチにより指定され、マクロでは定義できません。

このコマンドでマクロをリンクする前に、マクロを定義する必要があります。

(このコマンドの no バージョンを使用して)Smartport マクロを削除する前に、Smartport タイプから Smartport マクロの接続を解除する必要があります。

Smartport タイプをユーザ定義マクロに関連付けるには、マクロのペアを定義する必要があります。片方は設定を適用するためのマクロで、もう片方(アンチマクロ)は設定を削除するためのマクロです。このマクロは名前でペアになっています。アンチマクロの名前は、no_ と対応するマクロの名前を連結したものになります。マクロの定義の詳細については、「マクロ コマンド」セクションを参照してください。

ユーザ定義マクロ my_ip_phone_desktop を Smartport タイプ ip_phone_desktop にリンクして、その 2 つのパラメータに値を指定するには、次のようにします。

switchxxxxxx(config)# macro auto user smartport macro ip_phone_desktop my_ip_phone_desktop $p1 1 $p2 2

show macro auto ports

show macro auto ports EXEC モード コマンドは、すべての Smartport ポートまたは特定の Smartport ポートに関する情報を表示します。ポートでマクロが実行されて失敗した場合、そのポートのタイプは Unknown と表示されます。

構文

show macro auto ports [interface-id | detailed]

パラメータ

  • interface-id:インターフェイス識別子(イーサネット インターフェイス、ポート チャネル)。

  • detailed:現在のポートに加えて、現在のポート以外のポートの情報を表示します。

デフォルト設定

すべてのポートに関する情報が表示されます。

コマンド モード

ユーザ EXEC モード

例 1:switch タイプと phone タイプの Smartport が自動的に設定されていることに注目してください。ルータの Smartport は静的に設定されています。Auto Smartport はグローバルに有効になります。

switchxxxxxx# show macro auto ports
Smartport is enabled
Administrative Globally Auto Smartport is enabled
Operational Globally Auto Smartport is enabled

Interface
-----------
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4

Auto Smartport
Admin State
-------------- disabled
disabled
enabled
enabled

Persistent
State
----------
enabled
enabled
disabled
enabled

Smartport Type
--------------
router(static)
switch
default
phone

例 2:switch タイプと phone タイプの Smartport が自動的に設定されていることに注目してください。ルータの Smartport は静的に設定されています。Auto Smartport はグローバルに有効になります。

switchxxxxxx# show macro auto ports
Smartport is enabled
Administrative Globally Auto Smartport is disabled
Operational Globally Auto Smartport is disabled

Interface
-----------
gi1/0/1
gi1/0/2
gi1/0/3
gi1/0/4

Auto Smartport
Admin State
-------------- disabled
disabled
enabled
enabled

Persistent
State
----------
enabled
enabled
disabled
enabled

Smartport Type
--------------
router(static)
switch
default
phone

例 3:gi1/0/2 の Auto SmartPort を無効にします。

switchxxxxxx(config)# interface gi1/0/2
switchxxxxxx(config-if)# no macro auto smartport
switchxxxxxx(config-if)# end
switchxxxxxx# show macro auto ports gi1/0/2
SmartPort is Enabled
Administrative Globally Auto SmartPort is controlled
Operational Globally Auto SmartPort is enabled
Auto SmartPort is disabled on gi1/0/2
Persistent state is not-persistent
Interface type is default
No macro has been activated

例 4:gi1/0/1 の Auto Smartport を有効にします。

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# macro auto smartport
switchxxxxxx(config-if)# end
switchxxxxxx# show macro auto ports gi1/0/1
SmartPort is Enabled
Administrative Globally Auto SmartPort is enabled
Operational Globally Auto SmartPort is enabled
Auto SmartPort is enabled on gi1/0/1
Persistent state is persistent
Interface type is switch
Last activated macro is switch

show macro auto processing

show macro auto processing EXEC モード コマンドは、どちらのプロトコル(CDP または LLDP)が有効で、どのデバイス タイプを自動的に検出できるかに関する情報を表示します。

構文

show macro auto processing

パラメータ

このコマンドには、パラメータやキーワードはありません。

デフォルト設定

なし

コマンド モード

ユーザ EXEC モード

switchxxxxxx# show macro auto processing
CDB: enabled
LLDP: enabled
host            :disabled
ip_phone        :enabled
ip_phone_desktop:enabled
switch          :enabled
router          :disabled
ap              :enabled

show macro auto smart-macros

show macro auto smart-macros EXEC モード コマンドは、Smartport マクロの名前、そのタイプ(組み込みまたはユーザ定義)、およびそのパラメータを表示します。この情報は、すべての Smartport タイプまたは指定されたタイプについて表示されます。

構文

show macro auto smart-macros [smartport-type]

パラメータ

  • smartport-type:Smartport タイプ(範囲:printerdesktopguestserverhostip_cameraip_phoneip_phone_desktopswitchrouter、または ap(ワイヤレス アクセス ポイント))。

デフォルト設定

なし

コマンド モード

ユーザ EXEC モード

switchxxxxxx# show macro auto smart-macros
SG300-52-R#show macro auto smart-macros
SmartPort type : printer
Parameters     : $native_vlan=1
SmartPort Macro: printer (Built-In)
SmartPort type : desktop
Parameters     : $max_hosts=10 $native_vlan=1
SmartPort Macro: desktop (Built-In)
SmartPort type : guest
Parameters     : $native_vlan=1
SmartPort Macro: guest (Built-In)
SmartPort type : server
Parameters     : $max_hosts=10 $native_vlan=1
SmartPort Macro: server (Built-In)
SmartPort type : host
Parameters     : $max_hosts=10 $native_vlan=1
SmartPort Macro: host (Built-In)
SmartPort type : ip-camera
Parameters     : $native_vlan=1
SmartPort Macro: ip_camera (Built-In)
SmartPort type : ip-phone
Parameters     : $max_hosts=10 $native_vlan=1 $voice_vlan=1
SmartPort Macro: ip_phone (Built-In)
SmartPort type : ip-phone-desktop
Parameters     : $max_hosts=10 $native_vlan=1 $voice_vlan=1
SmartPort Macro: ip_phone_desktop (Built-In)
SmartPort type : switch
Parameters     : $native_vlan=1 $voice_vlan=1
SmartPort Macro: switch (Built-In)
SmartPort type : router
Parameters     : $native_vlan=1 $voice_vlan=1
SmartPort Macro: router (Built-In)
SmartPort type : ap
Parameters     : $native_vlan=1 $voice_vlan=1
SmartPort Macro: ap (Built-In)
SG300-52-R#

smartport storm-control

インターフェイスでブロードキャスト、マルチキャスト、またはユニキャスト ストーム制御を有効にするには、インターフェイス(イーサネット、ポート チャネル)コンフィギュレーション モードで storm-control コマンドを使用します。デフォルトに戻すには、このコマンドの no 形式を使用します。

構文

smartport storm-control broadcast {level level | kbps kbps} [trap] [shutdown]

no smartport storm-control broadcast

smartport storm-control multicast [registred | unregistred] {level level | kbps kbps} [trap] [shutdown]

no smartport storm-control multicast

smartport storm-control unicast {level level | kbps kbps} [trap] [shutdown]

no smartport storm-control unicast

no smartport storm-control

パラメータ

  • broadcast:ポートでブロードキャスト ストーム制御を有効にします。

  • multicast [registred | unregistred]:すべてのマルチキャスト、登録済みマルチキャストのみ、未登録マルチキャスト ストーム制御のみのいずれかをポートで有効にします。

  • unicast:ポートでユニキャスト不明ストーム制御を有効にします。

  • level level:抑制レベル(%)。指定した level の値に達した場合、ストーム パケットのフラッディングをブロックします。(範囲:1 ~ 100)

  • kbps kbps:ポートにおける最大ブロードキャスト トラフィック(キロビット/秒)。(範囲:1 ~ 10000000)

  • trap:(オプション)ストームがポートで発生したときにトラップを送信します。このキーワードが指定されないと、トラップは送信されません。

  • shutdown:(オプション)ストームがポートで発生したときに、ポートをシャットダウンします。このキーワードが指定されないと、余剰トラフィックは廃棄されます。

デフォルト設定

ストーム制御は無効です。

コマンド モード

インターフェイス(イーサネット、ポート チャネル)コンフィギュレーション モード

例 1:ポート 1 でのブロードキャスト トラフィックのキロビット/秒の最大数を 10000 に設定します。

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# smartport storm-control broadcast kpbs 10000

例 2:ポート 1 のブロードキャスト トラフィック(キロビット/秒)の最大パーセンテージを 30% に設定します。

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# smartport storm-control broadcast level 30