Ciscoスイッチのポートミラーリング設定

概要

Cisciスイッチでポートミラーリングを行い、パケットキャプチャを行った際にメモです。

空いているmonitorのsession番号を指定してミラーリングの設定を行います。

monitorの設定の確認

まずsession番号1がすでに使われていないか確認します。
以下コマンドで確認出来ます。

# show monitor session 1


下記のような出力ならsession 1は未使用なので使っても大丈夫です。

No SPAN configuration is present in the system for session [1].


monitorの設定

  • session番号1番を使用
  • GigabitEthernet1/0/1のパケットをGigabitEthernet1/0/2ミラーリング
  • filter設定でVLAN番号100番のパケットだけキャプチャ
# configure terminal
(config)# monitor session 1 source interface GigabitEthernet1/0/1
(config)# monitor session 1 filter vlan 100
(config)# monitor session 1 destination interface GigabitEthernet1/0/2


monitorの設定の確認

#show monitor session 1
Session 1
---------
Type                   : Local Session
Source Ports           :
    Both               : Gi1/0/1
Destination Ports      : Gi1/0/2
    Encapsulation      : Native
          Ingress      : Disabled
Filter VLANs           : 100

上記のようになっていれば正しく設定されています。

monitor設定の削除

不要になったら以下で設定を削除しておきます。

no monitor session 1