The 4500 series catalyst switches with the Supervisor 7 has a new built in functionality with IOS-XE version 3.3(0) / 151.1 or higher. This built in wireshark has the ability to capture packets in the way we would traditionally use SPAN with an attached PC for capturing packets in a troubleshooting scenario.
Wireshark feature conditions
To utilize the Wireshark feature you must meet the following conditions.
4500 series Catalyst switch
Supervisor 7 (supervisor 6 is unsupported at this time)
Feature set IP Base and Enterprise Services (LAN Base is unsupported)
Switch CPU is not in a high utilization condition as the Wireshark feature is CPU intensive and will software switch certain packets during capture.
The following is a quick start guide to get a capture started. This is very general and you will need implement filters and buffer setting as needed to limit the excessive capture of packets if troubleshooting in a production network.
Verify and Capture
1) Verify you meet the conditions to support the capture.
4500TEST#show versionCisco IOS Software, IOS-XE Software, Catalyst 4500 L3 Switch Software (cat4500e-UNIVERSAL-M), Version 03.03.00.SG RELEASE SOFTWARE (fc3)<output omitted>License Information for 'WS-X45-SUP7-E' License Level: entservices Type: Permanent Next reboot license Level: entservicescisco WS-C4507R+E (MPC8572) processor (revision 8) with 2097152K/20480K bytes of memory.Processor board ID FOX1512GWG1MPC8572 CPU at 1.5GHz, Supervisor 7<output omitted>4500TEST#show proc cpu historyHistory information for system: 888844444222222222222222333334444422222222222222255555222222100 90 80 70 60 50 40 30 20 10 **** ***** 0....5....1....1....2....2....3....3....4....4....5....5.... 0 5 0 5 0 5 0 5 0 5 CPU% per second (last 60 seconds)
2) In this example I am capturing traffic in a TX/RX direction from port gig2/26. We will store the capture file on bootflash in a pcap file format for review from a local PC if necessary. The config is done from User EXEC mode, not global config mode.
4500TEST#monitor capture MYCAP interface g2/26 both4500TEST#monitor capture file bootflash:MYCAP.pcap4500TEST#monitor capture MYCAP match any start*Sep 13 15:24:32.012: %BUFCAP-6-ENABLE: Capture Point MYCAP enabled.
3) This will capture all traffic ingress and egress on port g2/26. This will surely fill the file very quickly with useless traffic in a production situation unless you specify the direction you are looking for and apply capture filters to narrow down the scope of interesting traffic to be captured.
Or you can manually stop the capture with the following command
4500TEST#monitor capture MYCAP stop
5) Another added feature is you can view the capture from the CLI. You can view the packets with the following command. The detail option is available at the end to view the actual packet if it is required to see inside the packets in a wireshark format. Also the dump option is available to see the hex value of the packet as well.
6) This can get cluttered and confusing if you didn't use a capture-filter when starting the capture. In this case we can utilize the display-filter option to only give us specific traffic in our display. We only want to see ICMP traffic, and not the HSRP, STP, and CDP traffic seen above. As the display filter is the same format as wireshark you can find the filters online.
By default the limit on the capture file size is 100 packets or 60 seconds in a linear file. Using the limit option on the monitor capture syntax can change this.
4500TEST#monitor cap MYCAP limit ?duration Limit total duration of capture in secondspacket-length Limit the packet length to capturepackets Limit number of packets to capture
The buffer size max is 100 MB. This can be adjusted as well as the circular/linear buffer setting as shown.
4500TEST#monitor cap MYCAP buffer ?circular circular buffersize Size of buffer
The built in wireshark feature on the Sup7 IOS-XE 3.3(0) is a very powerful tool and if used correctly can save time and resources when troubleshooting in customers network. Caution must be used when utilizing the feature as it does have to potential to increase CPU utilization in high traffic situations. And should never be configured and left unattended. If used properly it is an invaluable tool to troubleshooting on the 4500 platform.
Due to hardware limitations it is possible to have out of order packets appear in your capture file. This is due to the separate buffers used for ingress and egress packet capturing. If you have out of order packets appear in your capture, set your buffer to both ingress. This will prevent the packets in egress getting processed before the ingress packets when the buffer is processed.
In the above example if you see out of order packets, it is recommended to change your configuration from "both" to "in" on both interfaces.