トラブル・シューティングで欠かせないのが,トラフィックのミラーリングです。
シスコではSPAN(Switched Port Analyzer)という呼び方をします。
設定で実践してみましょう。
●SPANの設定
SPANを設定するときは,キャプチャの対象とするトラフィックが流れるポートと,出力ポートを設定します。
sourceが「キャプチャする対象」で,destinaitionが「LANアナライザを接続するポート」になります。
今回は,「Fa0/1」に流れるポートを「Fa0/11」にミラーリングしてやります。
SwitchA(config)#monitor session 1 source interface fastEthernet 0/1
SwitchA(config)#monitor session 1 destination interface fastEthernet 0/11
オプション設定で,「送信パケットのみ(rx)」,「受信パケットのみ(tx)」,「特定のVLANを通過したパケット」など,細かい設定もできます。
設定は以上です。
●動作の確認
設定をしたら動作を確認してみましょう。
SPANの確認は,show monitor sessionコマンドを使います。
SwitchA#show monitor session 1
Session 1
---------
Type : Local Session
Source Ports :
Both : Fa0/1
Destination Ports : Fa0/11
Encapsulation : Native
Ingress : Disabled
送信元ポート(Source Ports)がFa0/11で,あて先ポート(Destination Port)がFa0/11になっているのがわかります。
また,送信元ポートは,送信トラフィックと受信トラフィックの両方(Both)になっているのもわかります。
detailオプションを付けると,VLANやカプセル化などの詳しい情報が表示されます。
SwitchA#show monitor session 1 detail
Session 1
---------
Type : Local Session
Source Ports :
RX Only : None
TX Only : None
Both : Fa0/1
Source VLANs :
RX Only : None
TX Only : None
Both : None
Source RSPAN VLAN : None
Destination Ports : Fa0/11
Encapsulation : Native
Ingress : Disabled
Reflector Port : None
Filter VLANs : None
Dest RSPAN VLAN : None
また,show interfaceコマンドでSPANの宛先ポート(Fa0/11)を見ると,ラインプロトコルのところに(monitoring)と出て,このポートがSPANのモニタリング用ポートになっているのが確認できます。
SwitchA#show interfaces fastEthernet 0/11
FastEthernet0/11 is up, line protocol is down (monitoring)
Hardware is Fast Ethernet, address is 000e.d7f6.918b (bia 000e.d7f6.918b)
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s, media type is 10/100BaseTX
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:17:04, output 00:14:51, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
226 packets input, 29395 bytes, 0 no buffer
Received 221 broadcasts (0 multicast)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 15 multicast, 0 pause input
0 input packets with dribble condition detected
986 packets output, 86641 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 PAUSE output
0 output buffer failures, 0 output buffers swapped out
この状態で,SwitchAのFa11にWiresharkなどをつないで,PC(192.168.1.1)からサーバー(192.168.1.2)にpingを打ってみると,ICMPのパケットがきちんとキャプチャできるはずです。
Catalyst スイッチド ポート アナライザ(SPAN)機能の設定
http://www.cisco.com/japanese/warp/public/3/jp/service/tac/473/41-j.shtml |