22. その他設定

22.1. ゼロタッチプロビジョニングの登録コンフィグに必要な設定

ゼロタッチプロビジョニングに登録するコンフィグの推奨設定例です。
グループIDとグループパスワードは、事前に以下の内容でNetMeisterに登録済みとします。
../_images/netmeister.png ../_images/other_ztp.png

22.1.1. コンフィグ内容

hostname IX-R2520
!
nm provisioning disable
!
username test-user password plain test-password administrator
!
nm ip enable
nm account sample-group password plain sample-password
nm sitename tokyo
!
  :
(その他ルーティング設定やIPアドレス設定などの構成に応じたコンフィグ)

22.1.2. コンフィグの解説

nm provisioning disable

ゼロタッチプロビジョニング動作は以下の3パターンあり、パターン毎に必要な設定が異なります。

  1. 初回のみコンフィグダウンロードし、その後はゼロタッチプロビジョニングを無効とするパターン


    NetMeister上のゼロタッチプロビジョニング設定で[初回コンフィグダウンロード後、無効にする]を選択、かつ登録コンフィグに"nm provisioning disable"設定を入れます。
    "nm provisioning disable"設定は、ゼロタッチプロビジョニング機能を無効化します。
    "nm provisioning disable"設定がなくても、"nm provisioning enable"設定がない限りZTPスイッチをOFFにしてから装置起動することでゼロタッチプロビジョニング機能を無効化できます。
  2. ゼロタッチプロビジョニングの登録コンフィグを変更および本装置を再起動するたびにコンフィグダウンロードさせ、かつ本装置にコンフィグを保存するパターン


    NetMeister上のゼロタッチプロビジョニング設定で[初回コンフィグダウンロードに成功した装置は、初回DL期限後もダウンロード可能とする]を選択、かつ登録コンフィグに"nm provisioning enable"設定を入れます。
    "nm provisioning enable"設定は、ゼロタッチプロビジョニング機能を有効化します。
    "nm provisioning enable"設定がなくても、"nm provisioning disable"設定がない限りZTPスイッチONのままでゼロタッチプロビジョニング機能を有効化できます。
  3. ゼロタッチプロビジョニングの登録コンフィグを変更および本装置を再起動するたびにコンフィグダウンロードさせ、かつ本装置にコンフィグを保存しないパターン


    NetMeister上のゼロタッチプロビジョニング設定で[初回コンフィグダウンロードに成功した装置は、初回DL期限後もダウンロード可能とする]を選択、かつ登録コンフィグに"nm provisioning enable no-saveconfig"設定を入れます。
    "nm provisioning enable no-saveconfig"設定は、ゼロタッチプロビジョニングでダウンロードしたコンフィグを本装置のスタートアップコンフィグに保存しない動作となります。
username test-user password plain test-password administrator
ゼロタッチプロビジョニング機能でNetMeisterからコンフィグをダウンロードした後、機器にログインするためのアカウント設定です。
ユーザーアカウント(ユーザー名 : test-user 、パスワード : test-password )をアドミニストレーター権限(管理者レベル)で設定します。
任意のユーザー名とパスワードを設定してください。
本設定はなくてもゼロタッチプロビジョニング動作できますが、その場合は機器ログイン時(初回ログイン専用のユーザー名 : admin、パスワード : admin)にログイン設定を行う必要があります。

22.2. DHCPリレーエージェントを使用する

DHCPリレーエージェントの設定例です。

../_images/other_dhcp-relay.png

22.2.1. 設定

22.2.1.1. 本装置の設定

Router# configure
Router(config)# interface GigaEthernet0.0
Router(config-GigaEthernet0.0)# ip address 10.0.0.1/24
Router(config-GigaEthernet0.0)# no shutdown
Router(config-GigaEthernet0.0)# exit
Router(config)# interface GigaEthernet2.0
Router(config-GigaEthernet2.0)# ip address 192.168.0.254/24
Router(config-GigaEthernet2.0)# ip dhcp-relay enable
Router(config-GigaEthernet2.0)# ip dhcp-relay server 10.0.0.254
Router(config-GigaEthernet2.0)# no shutdown
Router(config-GigaEthernet2.0)# exit
Router(config)#

22.2.2. 本装置の解説

interface GigaEthernet2.0
  ip dhcp-relay enable
  ip dhcp-relay server 10.0.0.254
DHCPリレーエージェント機能を有効化します。
DHCPサーバーのIPアドレスを設定します。

22.3. SNTPクライアントを使用する

NTPサーバーに時刻同期します。

../_images/other_ntp.png

22.3.1. 設定

22.3.1.1. 本装置の設定

Router# configure
Router(config)# ntp server 192.168.0.1
Router(config)# interface GigaEthernet2.0
Router(config-GigaEthernet2.0)# ip address 192.168.0.254/24
Router(config-GigaEthernet2.0)# no shutdown
Router(config-GigaEthernet2.0)# exit
Router(config)#

22.3.2. 解説

ntp server 192.168.0.1

NTPサーバーまたはSNTPサーバーのIPアドレスを指定します。

22.4. スケジューラーを使用する

スケジューラー機能を使用して、毎日AM03:00に装置を再起動させる設定例です。

../_images/other_scheduler.png

22.4.1. 設定

22.4.1.1. 本装置の設定

Router# configure
Router(config)# ntp server 192.168.0.1
Router(config)# command-action list reload-action
Router(config-command-action-reload-action)# command 10 reload y
Router(config-command-action-reload-action)# exit
Router(config)# scheduler timetable reload-action datetime 3 0
Router(config)# interface GigaEthernet2.0
Router(config-GigaEthernet2.0)# ip address 192.168.0.254/24
Router(config-GigaEthernet2.0)# no shutdown
Router(config-GigaEthernet2.0)# exit
Router(config)#

22.4.2. 解説

command-action list reload-action
  command 10 reload y
コマンドアクションリスト reload-action を作成します。
装置再起動コマンドを設定します。
scheduler timetable reload-action datetime 3 0
コマンドアクションリストの実行日時、間隔を設定します。
毎日AM03:00にコマンドアクションリスト reload-action を実行します。

22.5. PPPoEパススルーを使用する

PPPoEパススルーの設定例です。
PPPoEは、ブリッジしてインターネット通信します。
PPPoE以外は、IPv4ネットワークへ通信します。
../_images/other_passthrough.png

22.5.1. 設定

22.5.1.1. 本装置の設定

Router# configure
Router(config)# ip route default 203.0.113.2
Router(config)# bridge irb enable
Router(config)# bridge 1 bridge-only pppoe
Router(config)# interface GigaEthernet0.0
Router(config-GigaEthernet0.0)# ip address 203.0.113.1/30
Router(config-GigaEthernet0.0)# ip napt enable
Router(config-GigaEthernet0.0)# no shutdown
Router(config-GigaEthernet0.0)# exit
Router(config)# interface GigaEthernet1.0
Router(config-GigaEthernet1.0)# no ip address
Router(config-GigaEthernet1.0)# bridge-group 1
Router(config-GigaEthernet1.0)# no shutdown
Router(config-GigaEthernet1.0)# exit
Router(config)# interface GigaEthernet2.0
Router(config-GigaEthernet2.0)# ip address 192.168.0.254/24
Router(config-GigaEthernet2.0)# bridge-group 1
Router(config-GigaEthernet2.0)# no shutdown
Router(config-GigaEthernet2.0)# exit
Router(config)#

22.5.2. 解説

bridge irb enable
bridge 1 bridge-only pppoe
ブリッジ機能を有効化します。
ブリッジグループ : 1 は、PPPoEプロトコルのみをブリッジします。
interface GigaEthernet1.0
  bridge-group 1
interface GigaEthernet2.0
  bridge-group 1
ブリッジグループ : 1 を設定します。
GE1.0とGE2.0間でPPPoEプロトコルのみがブリッジされます。

22.6. SNMPエージェントを使用する

SNMPエージェント機能を使用して、SNMPマネージャーによりMIBとトラップを取得できるように設定します。

../_images/other_snmp.png

22.6.1. 設定

22.6.1.1. 本装置の設定

Router# configure
Router(config)# hostname my-router
my-router(config)# snmp-agent view mib-view 1.3.6.1.2.1
my-router(config)# snmp-agent ip trap-source GigaEthernet2.0
my-router(config)# snmp-agent ip community sample-community view mib-view
my-router(config)# snmp-agent ip host 192.168.0.1 sample-community version 2
my-router(config)# snmp-agent contact my-name
my-router(config)# snmp-agent location my-room
my-router(config)# interface GigaEthernet2.0
my-router(config-GigaEthernet2.0)# ip address 192.168.0.254/24
my-router(config-GigaEthernet2.0)# snmp-agent ip enable
my-router(config-GigaEthernet2.0)# no shutdown
my-router(config-GigaEthernet2.0)# exit
my-router(config)#

22.6.2. 解説

hostname my-router
本装置のホスト名を設定します。
ここで設定した文字列は、System MIBのsysName設定値になります。
sysNameには、一般的に管理のために付けられた本装置の名前を記入します。
snmp-agent view mib-view 1.3.6.1.2.1
SNMPマネージャーが取得できるMIB情報を限定するときに本コマンドを使用します。
本例の場合、 1.3.6.1.2.1(MIBⅡ) のみ取得可能になります。
snmp-agent ip trap-source GigaEthernet2.0

トラップの送信元インタフェースを設定します。

snmp-agent ip community sample-community view mib-view

SNMPコミュニティー名 : sample-community と、MIBビューの設定( MIBⅡのみ )を行います。

snmp-agent ip host 192.168.0.1 sample-community version 2

トラップの宛先IPアドレスを設定します。

snmp-agent contact my-name
System MIB(1.3.6.1.2.1.1)で取得するsysContactの値を文字列で設定します。
sysContactには、一般的に本装置を管理する人の名前や連絡先を記入します。
snmp-agent location my-room
System MIBで取得するsysLocationの値を文字列で設定します。
sysLocationには、一般的に本装置が設定されている物理的な場所を記入します。
interface GigaEthernet2.0
  snmp-agent ip enable

SNMPエージェント機能を有効化します。

22.7. syslogサーバーにログを送信する

syslogサーバーに取得したログを送信します。

../_images/other_syslog.png

22.7.1. 設定

22.7.1.1. 本装置の設定

Router# configure
Router(config)# syslog enable
Router(config)# syslog function all warn
Router(config)# syslog ip host 192.168.0.1
Router(config)# interface GigaEthernet2.0
Router(config-GigaEthernet2.0)# ip address 192.168.0.254/24
Router(config-GigaEthernet2.0)# no shutdown
Router(config-GigaEthernet2.0)# exit
Router(config)#

22.7.2. 解説

syslog enable
syslog function all warn

ログ取得(取得する機能 : all 、取得レベル : warn )の設定です。

syslog ip host 192.168.0.1

syslogサーバーのIPアドレスを設定します。

22.8. ポートモニターを使用する

ポートモニター機能を使って、本装置のSW-HUBポートで送受信したトラフィックを別のSW-HUBポートにミラーリングできます。
本例では、SW-HUBポート内のポート1で送受信したパケットをポート8にミラーリングします。
../_images/other_port-monitor.png

22.8.1. 設定

22.8.1.1. 本装置の設定

Router# configure
Router(config)# device GigaEthernet2
Router(config-GigaEthernet2)# port 1 mirror-port 8 both
Router(config-GigaEthernet2)# vlan-group 1 port 8
Router(config-GigaEthernet2)# exit
Router(config)# interface GigaEthernet2.0
Router(config-GigaEthernet2.0)# ip address 192.168.0.254/24
Router(config-GigaEthernet2.0)# no shutdown
Router(config-GigaEthernet2.0)# exit
Router(config)#

22.8.2. 解説

device GigaEthernet2
  port 1 mirror-port 8 both
  vlan-group 1 port 8
モニターポートをポート : 1、ミラーポートをポート : 8、モニターするトラフィックの方向を both (双方向)に設定します
ミラーポートに設定したポート : 8 を、モニターポートとは別のポートVLANに設定します。