インターフェイス テンプレート

インターフェイス テンプレートの制約事項

  • インターフェイス テンプレートは、ワイヤレスセッションには適用されません。

  • テンプレートのリモート保存とダウンロードはサポートされていません。

  • スイッチのポートとインターフェイス テンプレートに同じ設定を使用することはできません。

インターフェイス テンプレートに関する情報

インターフェイス テンプレートについて

インターフェイス テンプレートは、特定のポートに適用できる設定またはポリシーのコンテナです。インターフェイス テンプレートがアクセスポートに適用されると、アクセスポートで交換されるすべてのトラフィックに影響します。

インターフェイス テンプレートには、ユーザーテンプレートと組み込みテンプレートの 2 つのタイプがあります。組み込みテンプレートはシステムによって作成されます。

組み込みテンプレートは変更できます。変更した組み込みテンプレートを削除すると、テンプレートの元の定義が復元されます。

利用可能な組み込みテンプレートは次のとおりです。

  • AP_INTERFACE_TEMPLATE(アクセスポイント)

  • DMP_INTERFACE_TEMPLATE(デジタルメディアプレーヤー)

  • IP_CAMERA_INTERFACE_TEMPLATE

  • IP_PHONE_INTERFACE_TEMPLATE

  • LAP_INTERFACE_TEMPLATE(Lightweight アクセスポイント)

  • MSP_CAMERA_INTERFACE_TEMPLATE

  • MSP_VC_INTERFACE_TEMPLATE(ビデオ会議)

  • PRINTER_INTERFACE_TEMPLATE

  • ROUTER_INTERFACE_TEMPLATE

  • SWITCH_INTERFACE_TEMPLATE

  • TP_INTERFACE_TEMPLATE(TelePresence)

次に、組み込みインターフェイス テンプレートの例を示します。

Template Name       : IP_CAMERA_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast
 spanning-tree bpduguard enable
 switchport mode access
 switchport block unicast
 switchport port-security
 mls qos trust dscp
 srr-queue bandwidth share 1 30 35 5
 priority-queue out 
!

含めるコマンドを指定して、特定のユーザーテンプレートを作成することもできます。


(注)  


テンプレート名にスペースを含めることはできません。


グローバル コンフィギュレーション モードで template コマンドを使用して、インターフェイス テンプレートを作成できます。テンプレート コンフィギュレーション モードで、必要なコマンドを入力します。テンプレート コンフィギュレーション モードでは、次のコマンドを入力できます。

コマンド 説明
access-session

アクセスセッション固有のインターフェイスコマンドを設定します。

authentication

認証マネージャ インターフェイス コンフィギュレーション コマンドを設定します。

carrier-delay

インターフェイス移行の遅延を設定します。

dampening

イベント減衰を有効にします。

default

コマンドをデフォルト値に設定します。

description

インターフェイス固有の説明を設定します。

dot1x

IEEE 802.1X のインターフェイス コンフィギュレーション コマンドを設定します。

hold-queue

保留キューの深さを設定します。

ip

IP テンプレートを設定します。

keepalive

キープアライブを有効にします。

load-interval

インターフェイスのロード計算の間隔を指定します。

mab

MAC 認証バイパスインターフェイスを設定します。

mls

マルチレイヤスイッチング設定を有効にします。このコマンドは、テンプレート コンフィギュレーション モードで次のデバイスに使用できます。

  • Cisco Catalyst 2960-S シリーズ スイッチ

  • Cisco Catalyst 2960-X シリーズ スイッチ

  • Cisco Industrial Ethernet 3000 シリーズ スイッチ

peer

ポイント ツー ポイント インターフェイスのピアパラメータを設定します。

priority-queue

テンプレートの priority-queue サイズを設定します。このコマンドは、テンプレート コンフィギュレーション モードで次のデバイスに使用できます。

  • Cisco Catalyst 2960-S シリーズ スイッチ

  • Cisco Catalyst 2960-X シリーズ スイッチ

  • Cisco Industrial Ethernet 3000 シリーズ スイッチ

queue-set

テンプレートに QoS キューセットを設定します。このコマンドは、テンプレート コンフィギュレーション モードで次のデバイスに使用できます。

  • Cisco Catalyst 2960-S シリーズ スイッチ

  • Cisco Catalyst 2960-X シリーズ スイッチ

  • Cisco Industrial Ethernet 3000 シリーズ スイッチ

radius-server

RADIUS サーバー設定を有効にします。このコマンドは、テンプレート コンフィギュレーション モードで次のデバイスに使用できます。

  • Catalyst 4500E Supervisor Engine 7-E

  • Catalyst 4500E Supervisor Engine 7L-E

  • Catalyst 4500E Supervisor Engine 8-E

  • Catalyst 4500-X シリーズ スイッチ

service-policy

CPL サービスポリシーを設定します。

source

別のソースから設定を取得します。

spanning-tree

スパニング ツリー サブシステムを設定します。

storm-control

ストーム制御を設定します。

subscriber

サブスクライバの非アクティブタイムアウト値を設定します。

switchport

スイッチングモードの設定を設定します。

trust

インターフェイスの信頼の値を設定します。


(注)  


  • システム組み込みテンプレートは、実行中の設定には表示されず、編集した場合にのみ実行中の設定に表示されます。

  • ステートフル スイッチオーバーは、access-session swithcport mode access の両方がインターフェイス テンプレートに設定されている場合、失敗します。スイッチオーバーの失敗を回避するには、インターフェイス テンプレートではなく、インターフェイスで switchport mode access コマンドを設定します。

  • インターフェイス テンプレートを設定する場合は、必要なすべての依存コマンドを同じテンプレートに入力することを推奨します。2 つの異なるテンプレートで依存コマンドを設定しないことを推奨します。


ターゲットへのインターフェイス テンプレートのバインド

各テンプレートをターゲットにバインドできます。テンプレートのバインドまたはソーシングは、静的または動的に実行できます。テンプレートの静的バインドには、インターフェイスなどのターゲットへのテンプレートのバインドが含まれます。静的バインドを使用して一度にバインドできるテンプレートは 1 つだけです。別のテンプレートを同じターゲットに静的にバインドすると、以前バインドされていたテンプレートがバインド解除されます。静的バインドを設定するには、インターフェイス コンフィギュレーション モードで source template コマンドを使用します。

任意の数のテンプレートをターゲットに動的にバインドできます。組み込みのポリシーマップとパラメータマップを使用して動的バインドを設定するには、autoconf enable コマンドを使用して Autoconf 機能を有効にします。


(注)  


同じインターフェイスに対して同時に、静的および動的にテンプレートをバインドできます。


インターフェイス テンプレートを使用した設定の優先順位

優先順位は、動的にバインドされたテンプレートを介して適用される設定が最も高く、次にインターフェイスに直接適用される設定、静的にバインドされたテンプレートを介して適用される設定の順となります。類似のコマンドが異なる優先順位で存在する場合、最も優先順位の高いコマンドが適用されます。より高い優先順位の設定が適用されない場合、次に優先順位の高い設定がターゲットに適用されます。

複数のテンプレートをターゲットに動的にバインドできます。複数のテンプレートが動的にバインドされている場合、最後に適用されたテンプレートの優先順位が最も高くなります。

テンプレートを削除するには、すべてのターゲットへのバインディングを削除する必要があります。存在しないテンプレートをバインドすると、設定なしで新しいテンプレートが作成されます。

インターフェイス テンプレートの設定

ユーザー インターフェイス テンプレートを作成するには、次の作業を実行します。

手順

  コマンドまたはアクション 目的

ステップ 1

enable

例:


Device> enable

特権 EXEC モードを有効にします。

  • パスワードを入力します(要求された場合)。

ステップ 2

configure terminal

例:


Device# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 3

template name

例:


Device(config)# template user-template1
ユーザーテンプレートを作成し、テンプレート コンフィギュレーション モードを開始します。

(注)  

 
組み込みテンプレートはシステム生成です。

ステップ 4

load-interval interval

例:


Device(config-template)# load-interval 60
テンプレートの統計収集のサンプリング間隔を設定します。

(注)  

 
組み込みテンプレートはシステム生成です。

ステップ 5

description description

例:


Device(config-template)# description This is a user template
テンプレートの説明を設定します。

ステップ 6

keepalive number

例:


Device(config-template)# Keepalive 60
キープアライブタイマーを設定します。

ステップ 7

end

例:


Device(config)# end

グローバル コンフィギュレーション モードを終了し、特権 EXEC モードに戻ります。

インターフェイス テンプレートの静的バインドの設定

手順

  コマンドまたはアクション 目的

ステップ 1

enable

例:


Device> enable

特権 EXEC モードを有効にします。

  • パスワードを入力します(要求された場合)。

ステップ 2

configure terminal

例:


Device# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 3

interface type number

例:


Device(config)# interface GigabitEthernet 1/0/12

インターフェイスのタイプと番号を指定し、インターフェイス コンフィギュレーション モードを開始します。

ステップ 4

source template name

例:


Device(config-if)# source template user-template1

インターフェイス テンプレートをターゲットに静的に適用します。

ステップ 5

end

例:


Device(config-if)# end

インターフェイス コンフィギュレーション モードを終了し、特権 EXEC モードに戻ります。

静的バインドを確認するには、 show running-config interface int-name および show derived-config interface int-name コマンドを使用します。

Device# show running-config interface GigabitEthernet 1/0/12

Building configuration...

Current configuration : 71 bytes
!
interface GigabitEthernet1/0/12
source template user-template1
end
Device# show derived-config interface GigabitEthernet 1/0/12
Building configuration...

Derived configuration : 108 bytes
!
interface GigabitEthernet1/0/12
description This is a user template
load-interval 60
keepalive 60
end

インターフェイス テンプレートの動的バインドの設定

手順

  コマンドまたはアクション 目的

ステップ 1

enable

例:


Device> enable

特権 EXEC モードを有効にします。

  • パスワードを入力します(要求された場合)。

ステップ 2

configure terminal

例:


Device# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 3

interface type number

例:


Device(config)# interface GigabitEthernet 4/0/1

インターフェイスのタイプと番号を指定し、インターフェイス コンフィギュレーション モードを開始します。

ステップ 4

service-policy type control subscriber policymap-name

例:


Device(config-if)# service-policy type control subscriber POLICY-Gi1/0/12

インターフェイス テンプレートをターゲットに動的に適用します。

ステップ 5

end

例:


Device(config-if)# end

インターフェイス コンフィギュレーション モードを終了し、特権 EXEC モードに戻ります。

インターフェイス テンプレートの確認

以下にリストされている 1 つ以上のコマンドを使用して、インターフェイス テンプレート コンフィギュレーションを確認します。

手順


ステップ 1

enable

例:


Device> enable

特権 EXEC モードを有効にします。

  • パスワードを入力します(要求された場合)。

ステップ 2

show template interface all {all | binding {temp-name | all | target int-name} | brief }

すべてのインターフェイス テンプレート コンフィギュレーションを表示します。

ステップ 3

show template interface source {built-in [original] | user}{temp-name | all}}

インターフェイス テンプレート ソース コンフィギュレーションを表示します。

ステップ 4

show template service{all | binding target int-name | brief | source {aaa | built-in | user {temp-name | all}}

すべてのインターフェイス テンプレート サービス コンフィギュレーションを表示します。

インターフェイス ユーザー テンプレートの確認

Device# show template interface source user all
    Template Name : TEST-1
    Template Definition:   
    load-interval 60
    description TEST_1_TEMPLATE
    keepalive 200
			 !
    Template Name : TEST-2
    Template Definition:   
    load-interval 60
    description TEST-1_TEMPLATE
    keepalive 200	
Device#  show template interface source built-in all

Building configuration...

Template Name : AP_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode trunk
switchport nonegotiate
service-policy input AutoConf-4.0-Trust-Cos-Input-Policy
service-policy output AutoConf-4.0-Output-Policy
!
Template Name : DMP_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode access
switchport block unicast
switchport port-security
spanning-tree portfast
spanning-tree bpduguard enable
service-policy input AutoConf-4.0-Trust-Dscp-Input-Policy
service-policy output AutoConf-4.0-Output-Policy
!
Template Name : IP_CAMERA_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode access
switchport block unicast
switchport port-security
spanning-tree portfast
spanning-tree bpduguard enable
service-policy input AutoConf-4.0-Trust-Dscp-Input-Policy
service-policy output AutoConf-4.0-Output-Policy
!
Template Name : IP_PHONE_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode access
switchport block unicast
switchport port-security maximum 3
switchport port-security maximum 2 vlan access
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity
switchport port-security
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
spanning-tree bpduguard enable
service-policy input AutoConf-4.0-CiscoPhone-Input-Policy
service-policy output AutoConf-4.0-Output-Policy
ip dhcp snooping limit rate 15
load-interval 30
!
Template Name : LAP_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode access
switchport block unicast
switchport port-security violation protect
switchport port-security aging time 2
switchport port-security aging type inactivity
switchport port-security
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
spanning-tree bpduguard enable
ip dhcp snooping limit rate 15
load-interval 30
! 
Template Name : MSP_CAMERA_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode access
switchport block unicast
switchport port-security
spanning-tree portfast
spanning-tree bpduguard enable
!
Template Name : MSP_VC_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode access
switchport port-security
spanning-tree portfast
spanning-tree bpduguard enable
load-interval 30
!
Template Name : PRINTER_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode access
switchport port-security maximum 2
switchport port-security
spanning-tree portfast
spanning-tree bpduguard enable
load-interval 60
!
Template Name : ROUTER_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode trunk
spanning-tree portfast trunk
spanning-tree bpduguard enable
service-policy input AutoConf-4.0-Trust-Cos-Input-Policy
service-policy output AutoConf-4.0-Output-Policy
!
Template Name : SWITCH_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode trunk
service-policy input AutoConf-4.0-Trust-Cos-Input-Policy
service-policy output AutoConf-4.0-Output-Policy
!
Template Name : TP_INTERFACE_TEMPLATE
Modified : No
Template Definition :
switchport mode access
switchport port-security maximum 3
switchport port-security maximum 2 vlan access
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity
switchport port-security
storm-control broadcast level pps 1k
storm-control multicast level pps 2k
storm-control action trap
spanning-tree portfast
spanning-tree bpduguard enable
service-policy input AutoConf-4.0-Trust-Dscp-Input-Policy
service-policy output AutoConf-4.0-Output-Policy
ip dhcp snooping limit rate 15
load-interval 30
!
end
Device# show template interface source built-in all 

Building configuration...

Template Name       : AP_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 switchport mode trunk
 switchport nonegotiate
 mls qos trust cos
 srr-queue bandwidth share 1 30 35 5
 priority-queue out 
!
Template Name       : DMP_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast
 spanning-tree bpduguard enable
 switchport mode access
 switchport block unicast
 switchport port-security
 mls qos trust dscp
 srr-queue bandwidth share 1 30 35 5
 priority-queue out 
!
Template Name       : IP_CAMERA_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast
 spanning-tree bpduguard enable
 switchport mode access
 switchport block unicast
 switchport port-security
 mls qos trust dscp
 srr-queue bandwidth share 1 30 35 5
 priority-queue out 
!
Template Name       : IP_PHONE_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast
 spanning-tree bpduguard enable
 switchport mode access
 switchport block unicast
 switchport port-security maximum 3
 switchport port-security maximum 2 vlan access
 switchport port-security violation  restrict
 switchport port-security aging time 2
 switchport port-security aging type inactivity
 switchport port-security
 storm-control broadcast level pps 1k
 storm-control multicast level pps 2k
 storm-control action trap
 mls qos trust cos
 service-policy input AUTOCONF-SRND4-CISCOPHONE-POLICY
 ip dhcp snooping limit rate 15
 load-interval 30
 srr-queue bandwidth share 1 30 35 5
 priority-queue out 
!
Template Name       : LAP_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast
 spanning-tree bpduguard enable
 switchport mode access
 switchport block unicast
 switchport port-security violation  protect
 switchport port-security aging time 2
 switchport port-security aging type inactivity
 switchport port-security
 storm-control broadcast level pps 1k
 storm-control multicast level pps 2k
 storm-control action trap
 mls qos trust dscp
 ip dhcp snooping limit rate 15
 load-interval 30
 srr-queue bandwidth share 10 10 60 20
 priority-queue out 
!
Template Name       : MSP_CAMERA_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast
 spanning-tree bpduguard enable
 switchport mode access
 switchport block unicast
 switchport port-security
!
Template Name       : MSP_VC_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast
 spanning-tree bpduguard enable
 switchport mode access
 switchport block unicast
 switchport port-security violation  restrict
 switchport port-security aging time 2
 switchport port-security aging type inactivity
 switchport port-security
 ip dhcp snooping limit rate 15
 load-interval 30
!
Template Name       : PRINTER_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast
 spanning-tree bpduguard enable
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 load-interval 60
!
Template Name       : ROUTER_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast trunk
 spanning-tree bpduguard enable
 switchport mode trunk
 mls qos trust dscp
 srr-queue bandwidth share 1 30 35 5
 priority-queue out 
!
Template Name       : SWITCH_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 switchport mode trunk
 mls qos trust cos
 srr-queue bandwidth share 1 30 35 5
 priority-queue out 
!
Template Name       : TP_INTERFACE_TEMPLATE
Modified            : No
Template Definition :
 spanning-tree portfast
 spanning-tree bpduguard enable
 switchport mode access
 switchport port-security maximum 3
 switchport port-security maximum 2 vlan access
 switchport port-security violation  restrict
 switchport port-security aging time 2
 switchport port-security aging type inactivity
 switchport port-security
 storm-control broadcast level pps 1k
 storm-control multicast level pps 2k
 storm-control action trap
 ip dhcp snooping limit rate 15
 load-interval 30
!
End
Device# show template interface binding all
    Template-name               Source      Method          Interface
    =============               ====      ==========      ==========
IP_PHONE_INTERFACE_TEMPLATE    Built-in    Dynamic        Gi1/0/1, Gi1/0/2, Gi1/0/3
                                                          Gi1/0/4, Gi1/0/5, Gi1/0/6
                                                          Gi1/0/7, Gi1/0/8, Gi1/0/9
                                                          Gi1/0/10, Gi1/0/11, Gi1/0/12
                                                          Gi1/0/13, Gi1/0/14, Gi1/0/15
                                                          Gi1/0/16, Gi1/0/17, Gi1/0/18
                                                          Gi1/0/19, Gi1/0/20, Gi1/0/21
                                                          Gi1/0/22, Gi1/0/23, Gi1/0/24
                                                          Gi1/1/1, Gi1/1/2, Gi1/1/3
   
IP_PHONE_INTERFACE_TEMPLATE    Built-in     Static        Gi4/0/4
Device# show template interface binding target GigabitEthernet 1/0/4
 			Interface            Method       Source            Template     
    =========           ==========    =====             =========
    Gi1/0/4              Dynamic      built-in          IP_PHONE_INTERFACE_TEMPLATE 
                         Static       user              TEST
                         Dynamic      Modified-built-in TEST
Device# show template service all
 			  
    User-defined template:
    ====================== 

    Template Name      : SVC-1
    Template Definition:   
    vlan 100
    access-group acl1

    built-in template:
    ====================== 

    Template Name      : SVC-2
    Template Definition:   
    vlan 100
    access-group acl1

    aaa downloaded template:
    ==========================
    Template Name      : SVC-2
    Template Definition:   
    vlan 100
    access-group acl1

Device# show template binding target GigabitEthernet 1/0/4

  Interface Templates:
    Interface            method       Source            Template     
    =========           ==========    =====             =========
    Gi1/0/4              Dynamic      built-in          IP_PHONE_INTERFACE_TEMPLATE 
                         Static       user              TEST
                         Dynamic      Modified-built-in TEST
  Service Templates:
   Template            Source         Session-Mac      
   ========            ====           ================
   SVC1                user           aa-bb-cc-dd-ee-ff 
   SVC2                built-in       ab-ab-ab-ab-ab-ab
   SVC3                aaa            ac-ac-ac-ac-ac-ac

例:ユーザー インターフェイス テンプレートの設定

例:ユーザーテンプレートの設定

Device# enable
Device (config)# configure terminal
Device(config)# template user-template1
Device(config-template)# load-interval 60
Device(config-template)# description This is a user template
Device(config-template)# Keepalive 60
Device(config)# end

例:インターフェイス テンプレートのソーシング

Device> enable
Device# configure terminal
Device(config)# interface fastethernet 4/0/0
Device(config-if)# source template user-template1
Device(config-if)# end

例:インターフェイス テンプレートの動的バインド

Device> enable
Device# configure terminal
Device(config)# interface GigabitEthernet 4/0/1
Device(config-if)# service-policy type control subscriber POLICY_Gi1/0/12
Device(config-if)# end

インターフェイス テンプレートの機能履歴

次の表に、このモジュールで説明する機能のリリースおよび関連情報を示します。

これらの機能は、特に明記されていない限り、導入されたリリース以降のすべてのリリースで使用できます。

表 1. インターフェイス テンプレートの機能履歴
リリース

機能名

機能情報

Cisco IOS XE Fuji 16.9.2

インターフェイス テンプレート

インターフェイス テンプレートは、複数のコマンドを同時に設定してターゲット(インターフェイスなど)に関連付けるメカニズムを提供します。

Cisco Feature Navigator を使用すると、プラットフォームおよびソフトウェアイメージのサポート情報を検索できます。Cisco Feature Navigator にアクセスするには、https://cfnng.cisco.com に進みます。