This example shows how to use buffer capture:
Step 1: Launch a capture session with the buffer capture option by entering:
Switch# monitor capture mycap interface GigabitEthernet1/0/1 in
Switch# monitor capture mycap match ipv4 any any
Switch# monitor capture mycap buffer circular size 1
Switch# monitor capture mycap start
Step 2: Determine whether the capture is active by entering:
Switch# show monitor capture mycap
Status Information for Capture mycap
Target Type:
Interface: GigabitEthernet1/0/1, Direction: in
Status : Active
Filter Details:
IPv4
Source IP: any
Destination IP: any
Protocol: any
Buffer Details:
Buffer Type: CIRCULAR
Buffer Size (in MB): 1
File Details:
File not associated
Limit Details:
Number of Packets to capture: 0 (no limit)
Packet Capture duration: 0 (no limit)
Packet Size to capture: 0 (no limit)
Packets per second: 0 (no limit)
Packet sampling rate: 0 (no sampling)
Step 3: Display the packets in the buffer by entering:
Switch# show monitor capture mycap buffer brief
0.000000 10.1.1.215 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
1.000000 10.1.1.216 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
2.000000 10.1.1.217 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
3.000000 10.1.1.218 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
4.000000 10.1.1.219 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
5.000000 10.1.1.220 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
6.000000 10.1.1.221 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
7.000000 10.1.1.222 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
8.000000 10.1.1.223 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
9.000000 10.1.1.224 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
10.000000 10.1.1.225 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
11.000000 10.1.1.226 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
12.000000 10.1.1.227 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
13.000000 10.1.1.228 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
14.000000 10.1.1.229 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
15.000000 10.1.1.230 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
16.000000 10.1.1.231 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
17.000000 10.1.1.232 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
18.000000 10.1.1.233 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
19.000000 10.1.1.234 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
20.000000 10.1.1.235 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
21.000000 10.1.1.236 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
Notice that the packets have been buffered.
Step 4: Display the packets in other display modes.
Switch# show monitor capture mycap buffer detailed
Frame 1: 256 bytes on wire (2048 bits), 256 bytes captured (2048 bits)
Arrival Time: Apr 15, 2012 15:50:02.398966000 PDT
Epoch Time: 1334530202.398966000 seconds
[Time delta from previous captured frame: 0.000000000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.000000000 seconds]
Frame Number: 1
Frame Length: 256 bytes (2048 bits)
Capture Length: 256 bytes (2048 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ip:udp:data]
Ethernet II, Src: 00:00:00:00:03:01 (00:00:00:00:03:01), Dst: 54:75:d0:3a:85:3f (54:75:d0:3a:85:3f)
Destination: 54:75:d0:3a:85:3f (54:75:d0:3a:85:3f)
Address: 54:75:d0:3a:85:3f (54:75:d0:3a:85:3f)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Source: 00:00:00:00:03:01 (00:00:00:00:03:01)
Address: 00:00:00:00:03:01 (00:00:00:00:03:01)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
…
Switch# show monitor capture mycap buffer dump
0.000000 10.1.1.215 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
0000 54 75 d0 3a 85 3f 00 00 00 00 03 01 08 00 45 00 Tu.:.?........E.
0010 00 ee 00 00 00 00 40 11 59 25 0a 01 01 d7 14 01 ......@.Y%......
0020 01 02 4e 21 4e 22 00 da 6d e0 00 01 02 03 04 05 ..N!N"..m.......
0030 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 ................
0040 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 .......... !"#$%
0050 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 &'()*+,-./012345
0060 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 6789:;<=>?@ABCDE
0070 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 FGHIJKLMNOPQRSTU
0080 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 VWXYZ[\]^_`abcde
0090 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 fghijklmnopqrstu
00a0 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 vwxyz{|}~.......
00b0 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 ................
00c0 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 ................
00d0 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 ................
00e0 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 ................
00f0 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 03 3e d0 33 .............>.3
Step 5a: Clear the buffer by entering:
Switch# monitor capture mycap clear
Step 5b: Wait for 10 seconds.
Step 5c: Stop the traffic by entering:
Switch# monitor capture mycap stop
Step 6: Confirm that the same set of packets are displayed after this time gap by entering:
Switch# show monitor capture mycap buffer brief
0.000000 10.1.1.2 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
1.000000 10.1.1.3 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
2.000000 10.1.1.4 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
3.000000 10.1.1.5 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
4.000000 10.1.1.6 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
5.000000 10.1.1.7 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
6.000000 10.1.1.8 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
7.000000 10.1.1.9 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
8.000000 10.1.1.10 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
9.000000 10.1.1.11 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
Step 7: Wait for 10 seconds, then confirm that the same set of packets are displayed after this time gap by entering:
Switch# show monitor capture mycap buffer brief
0.000000 10.1.1.2 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
1.000000 10.1.1.3 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
2.000000 10.1.1.4 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
3.000000 10.1.1.5 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
4.000000 10.1.1.6 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
5.000000 10.1.1.7 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
6.000000 10.1.1.8 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
7.000000 10.1.1.9 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
8.000000 10.1.1.10 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
9.000000 10.1.1.11 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
Step 8: Repeat Step 7.
Step 9: Clear the buffer by entering:
Switch# monitor capture mycap clear
Step 10: Confirm that the buffer is now empty by entering:
Switch# show monitor capture mycap buffer brief
Step 11: Wait about 10 seconds, then display the buffer contents by entering:
Switch# show monitor capture mycap buffer brief
Step 12: Restart the traffic, wait for 10 seconds, then display the buffer contents by entering:
Switch# monitor capture mycap start
wait for 10 seconds...
Switch# show monitor capture mycap buffer brief
0.000000 10.1.1.2 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
1.000000 10.1.1.3 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
2.000000 10.1.1.4 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
3.000000 10.1.1.5 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
4.000000 10.1.1.6 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
5.000000 10.1.1.7 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
6.000000 10.1.1.8 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
7.000000 10.1.1.9 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
8.000000 10.1.1.10 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
9.000000 10.1.1.11 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
Step 13: Store the buffer contents to the mycap1.pcap file in the internal flash: storage device by entering:
Switch# monitor capture mycap export flash:mycap1.pcap
Exported Successfully
Step 14: Check that the file has been created and that it contains the packets by entering:
Switch# dir flash:mycap1.pcap
Directory of flash:/mycap1.pcap
14758 -rw- 20152 Apr 15 2012 16:00:28 -07:00 mycap1.pcap
831541248 bytes total (831340544 bytes free)
Switch# show monitor capture file flash:mycap1.pcap brief
1 0.000000 10.1.1.2 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
2 1.000000 10.1.1.3 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
3 2.000000 10.1.1.4 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
4 3.000000 10.1.1.5 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
5 4.000000 10.1.1.6 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
6 5.000000 10.1.1.7 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
7 6.000000 10.1.1.8 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
8 7.000000 10.1.1.9 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
9 8.000000 10.1.1.10 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
10 9.000000 10.1.1.11 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
11 10.000000 10.1.1.12 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
12 11.000000 10.1.1.13 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
13 12.000000 10.1.1.14 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
14 13.000000 10.1.1.15 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
15 14.000000 10.1.1.16 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
16 15.000000 10.1.1.17 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
Step 15: Stop the packet capture and display the buffer contents by entering:
Switch# monitor capture mycap stop
Switch# show monitor capture mycap buffer brief
0.000000 10.1.1.2 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
1.000000 10.1.1.3 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
2.000000 10.1.1.4 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
3.000000 10.1.1.5 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
4.000000 10.1.1.6 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
5.000000 10.1.1.7 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
6.000000 10.1.1.8 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
7.000000 10.1.1.9 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
8.000000 10.1.1.10 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
9.000000 10.1.1.11 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
10.000000 10.1.1.12 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
11.000000 10.1.1.13 -> 20.1.1.2 UDP Source port: 20001 Destination port: 20002
Step 16: Clear the buffer and then try to display packets from the buffer by entering:
Switch# monitor capture mycap clear
Switch# show monitor capture mycap buffer brief
Step 17: Delete the capture point by entering:
Switch# no monitor capture mycap