Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Prerequisites for
Wireshark
Wireshark is supported on Supervisor Engine 7-E,
Supervisor Engine 7L-E, Catalyst 3850, Catalyst 3650, Wireless LAN Controller
5700 Series, Catalyst 4500X-16, and Catalyst 4500X-32.
Restrictions for
Wireshark
Starting in
Cisco IOS Release XE 3.3.0(SE), global packet capture on Wireshark is not
supported.
Capture filters
are not supported.
The CLI for
configuring Wireshark requires that the feature be executed only from EXEC
mode. Actions that usually occur in configuration submode (such as defining
capture points), are handled at the EXEC mode instead. All key commands are not
NVGEN’d and are not synchronized to the standby supervisor in NSF and SSO
scenarios.
Packets
captured in the output direction of an interface might not reflect the changes
made by
switch rewrite (includes TTL, VLAN tag, CoS,
checksum, MAC addresses, DSCP, precedent, UP, etc.).
Limiting
circular file storage by file size is not supported.
Wireless Packet
Capture
The only form of
wireless capture is a CAPWAP tunnel capture.
When capturing
CAPWAP tunnels, no other interface types can be used as attachment points on
the same capture point.
Capturing
multiple CAPWAP tunnels is supported.
Core filters are
not applied and should be omitted when capturing a CAPWAP tunnel.
To capture a
CAPWAP data tunnel, each CAPWAP tunnel is mapped to a physical port and an
appropriate ACL will be applied to filter the traffic.
To capture a
CAPWAP non-data tunnel, the switch is set to capture traffic on all ports and
apply an appropriate ACL to filter the traffic.
Configuration
Limitations
Multiple capture
points can be defined, but only one can be active at a time. You need to stop
one before you can start the other.
Neither VRFs,
management ports, nor private VLANs can be used as attachment points.
Only one ACL of
each type (IPv4, IPv6, MAC) is allowed in a Wireshark class map. There can be a
maximum of three ACLs in a class map: one for IPv4, one for IPv6, and the other
for MAC.
Wireshark cannot
capture packets on a destination SPAN port.
Wireshark will
stop capturing when one of the attachment points (interfaces) attached to a
capture point stops working. For example, if the device that is associated with
an attachment point is unplugged from the
switch. To resume capturing, the capture must
be restarted manually.
CPU-injected
packets are considered control plane packets. Therefore, these types of packets
will not be captured on an interface egress capture.
MAC ACL is only
used for non-IP packets such as ARP. It will not be supported on a Layer 3 port
or SVI.
IPv6-based ACLs
are not supported in VACL.
Layer 2 and
Layer 3 EtherChannels are not supported.
ACL logging and
Wireshark are incompatible. Once Wireshark is activated, it takes priority. All
traffic, including that being captured by ACL logging on any ports, will be
redirected to Wireshark. We recommended that you deactivate ACL logging before
starting Wireshark. Otherwise, Wireshark traffic will be contaminated by ACL
logging traffic.
Wireshark does
not capture packets dropped by floodblock.
If you capture
both PACL and RACL on the same port, only one copy is sent to the CPU. If you
capture a DTLS-encrypted CAPWAP interface, two copies are sent to Wireshark,
one encrypted and the other decrypted. The same behavior will occur if we
capture a Layer 2 interface carrying DTLS-encrypted CAPWAP traffic. The core
filter is based on the outer CAPWAP header.
Information About Wireshark
Wireshark
Overview
Wireshark is a packet
analyzer program, formerly known as Ethereal, that supports multiple protocols
and presents information in a text-based user interface.
The ability to capture
and analyze traffic provides data on network activity. Prior to Cisco IOS
Release XE 3.3.0(SE), only two features addressed this need: SPAN
and debug platform packet. Both have limitations. SPAN is ideal for capturing
packets, but can only deliver them by forwarding them to some specified local
or remote destination; it provides no local display or analysis support. The
debug platform
packet command is specific to the Catalyst 4500 series and only
works on packets that come from the software process-forwarding path. Also, the
debug platform
packet command has limited local display capabilities and no
analysis support.
So the need exists for
a traffic capture and analysis mechanism that is applicable to both hardware
and software forwarded traffic and that provides strong packet capture,
display, and analysis support, preferably using a well known interface.
Wireshark dumps
packets to a file using a well known format called .pcap, and is applied or
enabled on individual interfaces. You specify an interface in EXEC mode along
with the filter and other parameters. The Wireshark application is applied only
when you enter a
start command,
and is removed only when Wireshark stops capturing packets either automatically
or manually.
Capture Points
A capture point is the central policy definition of the Wireshark feature. The capture point describes all of the characteristics associated with a given instance of Wireshark: which packets to capture, where to capture them from, what to do with the captured packets, and when to stop. Capture points can be modified after creation, and do not become active until explicitly activated with a start command. This process is termed activating the capture point or starting the capture point. Capture points are identified by name and can also be manually or automatically deactivated or stopped.
Multiple capture points can be defined, but only one can be active at a time. You need to stop one before you can start the other.
Attachment Points
An attachment point is a point in the logical packet process path associated with a capture point. An attachment point is an attribute of the capture point. Packets that impact an attachment point are tested against capture point filters; packets that match are copied and sent to the associated Wireshark instance of the capture point. A specific capture point can be associated with multiple attachment points, with limits on mixing attachment points of different types. Some restrictions apply when you specify attachment points of different types. Attachment points are directional (input or output or both) with the exception of the Layer 2 VLAN attachment point, which is always bidirectional.
Filters
Filters are attributes of a capture point that identify and limit the subset of traffic traveling through the attachment point of a capture point, which is copied and passed to Wireshark. To be displayed by Wireshark, a packet must pass through an attachment point, as well as all of the filters associated with the capture point.
A capture point has the following types of filters:
Core system filter—The core system filter is applied by hardware, and its match criteria is limited by hardware. This filter determines whether hardware-forwarded traffic is copied to software for Wireshark purposes.
Display filter—The display filter is applied by Wireshark. Packets that fail the display filter are not displayed.
Core System Filter
You can specify core system filter match criteria by using the class map or ACL, or explicitly by using the CLI.
Note
When specifying CAPWAP as an attachment point, the core system filter is not used.
In some installations, you need to obtain authorization to modify the switch configuration, which can lead to extended delays if the approval process is lengthy. This can limit the ability of network administrators to monitor and analyze traffic. To address this situation, Wireshark supports explicit specification of core system filter match criteria from the EXEC mode CLI. The disadvantage is that the match criteria that you can specify is a limited subset of what class map supports, such as MAC, IP source and destination addresses, ether-type, IP protocol, and TCP/UDP source and destination ports.
If you prefer to use configuration mode, you can define ACLs or have class maps refer capture points to them. Explicit and ACL-based match criteria are used internally to construct class maps and policy maps.
Note The ACL and class map configuration are part of the system and not aspects of the Wireshark feature.
Display Filter
With the display filter, you can direct Wireshark to further narrow the set of packets to display when decoding and displaying from a .pcap file.
Wireshark can be invoked on live traffic or on a previously existing .pcap file. When invoked on live traffic, it can perform four types of actions on packets that pass its display filters:
Captures to buffer in memory to decode and analyze and store
Stores to a .pcap file
Decodes and displays
Stores and displays
When invoked on a .pcap file only, only the decode and display action is applicable.
Storage of Captured
Packets to Buffer in Memory
Packets can be stored
in the capture buffer in memory for subsequent decode, analysis, or storage to
a .pcap file.
The capture buffer can
be in linear or circular mode. In linear mode, new packets are discarded when
the buffer is full. In circular mode, if the buffer is full, the oldest packets
are discarded to accommodate the new packets. Although the buffer can also be
cleared when needed, this mode is mainly used for debugging network traffic.
Note
If you have more than one capture that is storing packets in a
buffer, clear the buffer before starting a new capture to avoid memory loss.
Storage of Captured
Packets to a .pcap File
Note
When WireShark is
used on switches in a stack, packet captures can be stored only on flash or USB
flash devices connected to the active switch.
For example, if
flash1 is connected to the active switch, and
flash2 is connected to the secondary switch, only
flash1 can be used to store packet captures.
Attempts to store
packet captures on devices other than flash or USB flash devices connected to
the active switch will probably result in errors.
Wireshark can store
captured packets to a .pcap file. The capture file can be located on the
following storage devices:
Switch
on-board flash storage (flash:)
USB drive
(usbflash0:)
Note
Attempts to store
packet captures on unsupported devices or devices not connected to the active
switch will probably result in errors.
When configuring a
Wireshark capture point, you can associate a filename. When the capture point
is activated, Wireshark creates a file with the specified name and writes
packets to it. If the file already exists when the file is associated or the
capture point is activated, Wireshark queries you as to whether the file can be
overwritten. Only one capture point may be associated with a given filename.
If the destination of
the Wireshark writing process is full, Wireshark fails with partial data in the
file. You must ensure that there is sufficient space in the file system before
you start the capture session. With Cisco IOS Release IOS XE 3.3.0(SE), the file system full status is not detected
for some storage devices.
You can reduce the
required storage space by retaining only a segment, instead of the entire
packet. Typically, you do not require details beyond the first 64 or 128 bytes.
The default behavior is to store the entire packet.
To avoid possible
packet drops when processing and writing to the file system, Wireshark can
optionally use a memory buffer to temporarily hold packets as they arrive.
Memory buffer size can be specified when the capture point is associated with a
.pcap file.
Packet Decoding and Display
Wireshark can decode and display packets to the console. This functionality is possible for capture points applied to live traffic and for capture points applied to a previously existing .pcap file.
Note
Decoding and displaying packets may be CPU intensive.
Wireshark can decode and display packet details for a wide variety of packet formats. The details are displayed by entering the monitor capture name start command with one of the following keyword options, which place you into a display and decode mode:
brief—Displays one line per packet (the default).
detailed—Decodes and displays all the fields of all the packets whose protocols are supported. Detailed modes require more CPU than the other two modes.
(hexadecimal) dump—Displays one line per packet as a hexadecimal dump of the packet data and the printable characters of each packet.
When you enter the capture command with the decode and display option, the Wireshark output is returned to Cisco IOS and displayed on the console unchanged.
Live Traffic Display
Wireshark receives copies of packets from the core system. Wireshark applies its display filters to discard uninteresting packets, and then decodes and displays the remaining packets.
.pcap File Display
Wireshark can decode and display packets from a previously stored .pcap file and direct the display filter to selectively displayed packets.
Packet Storage and Display
Functionally, this mode is a combination of the previous two modes. Wireshark stores packets in the specified .pcap file and decodes and displays them to the console. Only the core filters are applicable here.
Wireshark Capture Point Activation and Deactivation
After a Wireshark capture point has been defined with its attachment points, filters, actions, and other options, it must be activated. Until the capture point is activated, it does not actually capture packets.
Before a capture point is activated, some functional checks are performed. A capture point cannot be activated if it has neither a core system filter nor attachment points defined. Attempting to activate a capture point that does not meet these requirements generates an error.*
Note
*When performing a wireless capture with a CAPWAP tunneling interface, the core system filter is not required and cannot be used.
The display filters are specified as needed.
After Wireshark capture points are activated, they can be deactivated in multiple ways. A capture point that is storing only packets to a .pcap file can be halted manually or configured with time or packet limits, after which the capture point halts automatically.
When a Wireshark capture point is activated, a fixed rate policer is applied automatically in the hardware so that the CPU is not flooded with Wireshark-directed packets. The disadvantage of the rate policer is that you cannot capture contiguous packets beyond the established rate even if more resources are available.
Wireshark
Features
This section describes
how Wireshark features function in the
switch environment:
If port security
and Wireshark are applied on an ingress capture, a packet that is dropped by
port security will still be captured by Wireshark. If port security is applied
on an ingress capture, and Wireshark is applied on an egress capture, a packet
that is dropped by port security will not be captured by Wireshark.
Packets dropped by
Dynamic ARP Inspection (DAI) are not captured by Wireshark.
If a port that is
in STP blocked state is used as an attachment point and the core filter is
matched, Wireshark will capture the packets that come into the port, even
though the packets will be dropped by the switch.
Classification-based security features—Packets that are dropped by input
classification-based security features (such as ACLs and IPSG) are not caught
by Wireshark capture points that are connected to attachment points at the same
layer. In contrast, packets that are dropped by output classification-based
security features are caught by Wireshark capture points that are connected to
attachment points at the same layer. The logical model is that the Wireshark
attachment point occurs after the security feature lookup on the input side,
and symmetrically before the security feature lookup on the output side.
On ingress, a
packet goes through a Layer 2 port, a VLAN, and a Layer 3 port/SVI. On egress,
the packet goes through a Layer 3 port/SVI, a VLAN, and a Layer 2 port. If the
attachment point is before the point where the packet is dropped, Wireshark
will capture the packet. Otherwise, Wireshark will not capture the packet. For
example, Wireshark capture policies connected to Layer 2 attachment points in
the input direction capture packets dropped by Layer 3 classification-based
security features. Symmetrically, Wireshark capture policies attached to Layer
3 attachment points in the output direction capture packets dropped by Layer 2
classification-based security features.
Routed ports and
switch virtual interfaces (SVIs)—Wireshark cannot capture the output of an SVI
because the packets that go out of an SVI's output are generated by CPU. To
capture these packets, include the control plane as an attachment point.
VLANs—When a VLAN
is used as a Wireshark attachment point, packets are captured in the input
direction only.
Redirection
features—In the input direction, features traffic redirected by Layer 3 (such
as PBR and WCCP) are logically later than Layer 3 Wireshark attachment points.
Wireshark captures these packets even though they might later be redirected out
another Layer 3 interface. Symmetrically, output features redirected by Layer 3
(such as egress WCCP) are logically prior to Layer 3 Wireshark attachment
points, and Wireshark will not capture them.
SPAN—Wireshark
and SPAN sources are compatible. You can configure an interface as a SPAN
source and as a Wireshark attachment point simultaneously. Configuring a SPAN
destination port as a Wireshark attachment point is not supported.
You can capture
packets from a maximum of 1000 VLANs at a time, if no ACLs are applied. If ACLs
are applied, the hardware will have less space for Wireshark to use. As a
result, the maximum number of VLANs than can be used for packet capture at a
time will be lower. Using more than 1000 VLANs tunnels at a time or extensive
ACLs might have unpredictable results. For example, mobility may go down.
Note
Capturing an
excessive number of attachment points at the same time is strongly discouraged
because it may cause excessive CPU utilization and unpredictable hardware
behavior.
Wireless Packet
Capture in Wireshark
Wireless traffic
is encapsulated inside CAPWAP packets. However, capturing only a particular
wireless client's traffic inside a CAPWAP tunnel is not supported when using
the CAPWAP tunnel as an attachment point. To capture only a particular wireless
client's traffic, use the client VLAN as an attachment point and formulate the
core filter accordingly.
Limited decoding
of inner wireless traffic is supported. Decoding of inner wireless packets
inside encrypted CAPWAP tunnels is not supported.
No other
interface type can be used with the CAPWAP tunneling interface on the same
capture point. A CAPWAP tunneling interface and a Level 2 port cannot be
attachment points on the same capture point.
You cannot
specify a core filter when capturing packets for Wireshark via the CAPWAP
tunnel. However, you can use the Wireshark display filters for filtering
wireless client traffic against a specific wireless client.
You can capture
packets from a maximum of 135 CAPWAP tunnels at a time if no ACLs are applied.
If ACLs are applied, the hardware memory will have less space for Wireshark to
use. As a result, the maximum number of CAPWAP tunnels than can be used for
packet capture at a time will be lower. Using more than 135 CAPWAP tunnels at a
time or unsing extensive ACLs might have unpredictable results. For example,
mobility may go down.
Note
Capturing an
excessive number of attachment points at the same time is strongly discouraged
because it may cause excessive CPU utilization and unpredictable hardware
behavior.
Guidelines for
Wireshark
During Wireshark
packet capture, hardware forwarding happens concurrently.
Before starting a
Wireshark capture process, ensure that CPU usage is moderate and that
sufficient memory (at least 200 MB) is available.
If you plan to
store packets to a storage file, ensure that sufficient space is available
before beginning a Wireshark capture process.
The CPU usage
during Wireshark capture depends on how many packets match the specified
conditions and on the intended actions for the matched packets (store, decode
and display, or both).
Where possible,
keep the capture to the minimum (limit by packets, duration) to avoid high CPU
usage and other undesirable conditions.
Because packet
forwarding typically occurs in hardware, packets are not copied to the CPU for
software processing. For Wireshark packet capture, packets are copied and
delivered to the CPU, which causes an increase in CPU usage.
To avoid high CPU
usage, do the following:
Attach only
relevant ports.
Use a class
map, and secondarily, an access list to express match conditions. If neither is
viable, use an explicit, in-line filter.
Adhere
closely to the filter rules. Restrict the traffic type (such as, IPv4 only)
with a restrictive, rather than relaxed ACL, which elicits unwanted traffic.
Always limit
packet capture to either a shorter duration or a smaller packet number. The
parameters of the capture command enable you to specify the following:
Capture
duration
Number of
packets captured
File size
Packet
segment size
Run a capture
session without limits if you know that very little traffic matches the core
filter.
You might
experience high CPU (or memory) usage if:
You leave a
capture session enabled and unattended for a long period of time, resulting in
unanticipated bursts of traffic.
You launch a
capture session with ring files or capture buffer and leave it unattended for a
long time, resulting in performance or system health issues.
During a capture
session, watch for high CPU usage and memory consumption due to Wireshark that
may impact
switch performance or health. If these
situations arise, stop the Wireshark session immediately.
Avoid decoding
and displaying packets from a .pcap file for a large file. Instead, transfer
the .pcap file to a PC and run Wireshark on the PC.
You can define up
to eight Wireshark instances. An active
show command
that decodes and displays packets from a .pcap file or capture buffer counts as
one instance. However, only one of the instances can be active.
Whenever an ACL
that is associated with a running capture is modified, you must restart the
capture for the ACL modifications to take effect. If you do not restart the
capture, it will continue to use the original ACL as if it had not been
modified.
To avoid packet
loss, consider the following:
Use
store-only (when you do not specify the display option) while capturing live
packets rather than decode and display, which is an CPU-intensive operation
(especially in detailed mode).
If you have more than one capture that is storing packets in a
buffer, clear the buffer before starting a new capture to avoid memory loss.
If you use
the default buffer size and see that you are losing packets, you can increase
the buffer size to avoid losing packets.
Writing to
flash disk is a CPU-intensive operation, so if the capture rate is
insufficient, you may want to use a buffer capture.
The Wireshark
capture session operates normally in streaming mode where packets are both
captured and processed. However, when you specify a buffer size of at least 32
MB, the session automatically turns on
lock-step mode in which a Wireshark capture session is split into two phases:
capture and process. In the capture phase, the packets are stored in the
temporary buffer. The duration parameter in lock-step mode serves as capture
duration rather than session duration. When the buffer is full or the capture
duration or packet limit has been attained, a session transitions to the
process phase, wherein it stops accepting packets and starts processing packets
in the buffer. You can also stop the capture manually. You will see a message
in the output when the capture stops. With this second approach (lock-step
mode), a higher capture throughput can be achieved.
Note
If you
are capturing packets to a buffer, there is no file storage defined. Hence, you
must export your capture from the buffer to a static storage file. Use the
monitor
capturecapture-nameexportfile-location :
file-name command.
The streaming
capture mode supports approximately
1000 pps; lock-step
mode supports approximately
2 Mbps (measured with
256-byte packets).
When the matching traffic rate exceeds this number, you may experience packet
loss.
If you want to
decode and display live packets in the console window, ensure that the
Wireshark session is bounded by a short capture duration.
Note
Warning: A Wireshark
session with either a longer duration limit or no capture duration (using a
terminal with no auto-more support using the
term len 0
command) may make the console or terminal unusable.
When using
Wireshark to capture live traffic that leads to high CPU, usage, consider
applying a QoS policy temporarily to limit the actual traffic until the capture
process concludes.
All
Wireshark-related commands are in EXEC mode; no configuration commands exist
for Wireshark.
If you need to use
access list or class-map in the Wireshark CLI, you must define an access list
and class map with configuration commands.
No specific order
applies when defining a capture point; you can define capture point parameters
in any order, provided that CLI allows this. The Wireshark CLI allows as many
parameters as possible on a single line. This limits the number of commands
required to define a capture point.
All parameters
except attachment points take a single value. Generally, you can replace the
value with a new one by reentering the command. After user confirmation, the
system accepts the new value and overrides the older one. A
no form of
the command is unnecessary to provide a new value, but it is necessary to
remove a parameter.
Wireshark allows
you to specify one or more attachment points. To add more than one attachment
point, reenter the command with the new attachment point. To remove an
attachment point, use the
no form of
the command. You can specify an interface range as an attachment point. For
example, enter
monitor capture mycap
interface GigabitEthernet1/0/1 in where interface
GigabitEthernet1/0/1
is an attachment point.
If you also need to attach
interface GigabitEthernet1/0/2, specify it in another line as follows:
monitor capture mycap interface GigabitEthernet1/0/2
in
You can modify
any of the parameters of a capture point while a session is active, but you
must restart the session for the modifications to take effect.
The action you
want to perform determines which parameters are mandatory. The Wireshark CLI
allows you to specify or modify any parameter prior to entering the
start
command. When you enter the
start
command, Wireshark will start only after determining that all mandatory
parameters have been provided.
If the capture
file already exists, it provides a warning and receives confirmation before
proceeding. This prevents you from mistakenly overwriting a file.
The core filter
can be an explicit filter, access list, or class map. Specifying a newer filter
of these types replaces the existing one.
Note
A core filter
is required except when using a CAPWAP
tunnel interface as a capture point attachment point.
You can terminate
a Wireshark session with an explicit
stop command
or by entering
q in automore
mode. The session could terminate itself automatically when a stop condition
such as duration or packet capture limit is met.
Default Wireshark Configuration
The table below shows the default Wireshark configuration.
Feature
Default Setting
Duration
No limit
Packets
No limit
Packet-length
No limit (full packet)
File size
No limit
Ring file storage
No
Buffer storage mode
Linear
How to Configure Wireshark
To configure Wireshark, perform these basic steps.
Define a capture point.
(Optional) Add or modify the capture point's parameters.
Activate or deactivate a capture point.
Delete the capture point when you are no longer using it.
The example in this procedure defines a very simple capture point. If you choose, you can define a capture point and all of its parameters with one instance of the monitor capture command.
Note
You must define an attachment point, direction of capture, and core filter to have a functional capture point.
An exception to needing to define a core filter is when you are defining a wireless capture point using a CAPWAP tunneling interface. In this case, you do not define your core filter. It cannot be used.
In privileged EXEC mode, follow these steps to define a capture point.
SUMMARY STEPS
1.show capwap summary
2.monitor capture {capture-name}{interfaceinterface-typeinterface-id | control-plane}{in | out | both}
Displays the CAPWAP tunnels available as attachment points for a wireless capture.
Note
Use this command only if you are using a CAPWAP tunnel as an attachment point to perform a wireless capture. See the CAPWAP example in the examples section.
Step 2
monitor capture {capture-name}{interfaceinterface-typeinterface-id | control-plane}{in | out | both}
Example:
Switch# monitor capture mycap interface GigabitEthernet1/0/1 in
Defines the capture point, specifies the attachment point with which the capture point is associated, and specifies the direction of the capture.
The keywords have these meanings:
capture-name—Specifies the name of the capture point to be defined (mycap is used in the example).
(Optional) interfaceinterface-typeinterface-id—Specifies the attachment point with which the capture point is associated (GigabitEthernet1/0/1 is used in the example).
Note
Optionally, you can define multiple attachment points and all of the parameters for this capture point with this one command instance. These parameters are discussed in the instructions for modifying capture point parameters. Range support is also available both for adding and removing attachment points.
Use one of the following for interface-type:
GigabitEthernet—Specifies the attachment point as GigabitEthernet.
vlan—Specifies the attachment point as a VLAN.
Note
Only ingress capture (in) is allowed when using this interface as an attachment point.
capwap—Specifies the attachment point as a CAPWAP tunnel.
Note
When using this interface as an attachment point, a core filter cannot be used.
(Optional) control-plane—Specifies the control plane as an attachment point.
in | out | both—Specifies the direction of capture.
Switch# monitor capture mycap interface GigabitEthernet1/0/1 in match any
Defines the core system filter.
Note
When using the CAPWAP tunneling interface as an attachment point, do not perform this step because a core filter cannot be used.
The keywords have these meanings:
capture-name—Specifies the name of the capture point to be defined (mycap is used in the example).
match—Specifies a filter. The first filter defined is the core filter.
Note
A capture point cannot be activated if it has neither a core system filter nor attachment points defined. Attempting to activate a capture point that does not meet these requirements generates an error.
ipv4—Specifies an IP version 4 filter.
ipv6—Specifies an IP version 6 filter.
Step 4
show monitor capture {capture-name}[ parameter]
Example:
Switch# show monitor capture mycap parameter
monitor capture mycap interface GigabitEthernet1/0/1 in
monitor capture mycap match any
Displays the capture point parameters that you defined in Step 1 and confirms that you defined a capture point.
To define a capture point with a CAPWAP attachment point:
Switch# show capwap summary
CAPWAP Tunnels General Statistics:
Number of Capwap Data Tunnels = 1
Number of Capwap Mobility Tunnels = 0
Number of Capwap Multicast Tunnels = 0
Name APName Type PhyPortIf Mode McastIf
------ -------------------------------- ---- --------- --------- -------
Ca0 AP442b.03a9.6715 data Gi3/0/6 unicast -
Name SrcIP SrcPort DestIP DstPort DtlsEn MTU Xact
------ --------------- ------- --------------- ------- ------ ----- ----
Ca0 10.10.14.32 5247 10.10.14.2 38514 No 1449 0
Switch# monitor capture mycap interface capwap 0 bothSwitch# monitor capture mycap file location flash:mycap.pcapSwitch# monitor capture mycap file buffer-size 1Switch# monitor capture mycap start
*Aug 20 11:02:21.983: %BUFCAP-6-ENABLE: Capture Point mycap enabled.on
Switch# show monitor capture mycap parameter
monitor capture mycap interface capwap 0 in
monitor capture mycap interface capwap 0 out
monitor capture mycap file location flash:mycap.pcap buffer-size 1
Switch#
Switch# show monitor capture mycap
Status Information for Capture mycap
Target Type:
Interface: CAPWAP,
Ingress:
0
Egress:
0
Status : Active
Filter Details:
Capture all packets
Buffer Details:
Buffer Type: LINEAR (default)
File Details:
Associated file name: flash:mycap.pcap
Size of buffer(in MB): 1
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)
Switch#
Switch# show monitor capture file flash:mycap.pcap
1 0.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
2 0.499974 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
3 2.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
4 2.499974 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
5 3.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
6 4.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
7 4.499974 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
8 5.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
9 5.499974 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
10 6.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
11 8.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
12 9.225986 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
13 9.225986 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
14 9.225986 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
15 9.231998 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
16 9.231998 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
17 9.231998 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
18 9.236987 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
19 10.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
20 10.499974 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
21 12.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
22 12.239993 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
23 12.244997 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
24 12.244997 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
25 12.250994 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
26 12.256990 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
27 12.262987 10.10.14.2 -> 10.10.14.32 DTLSv1.0 Application Data
28 12.499974 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
29 12.802012 10.10.14.3 -> 10.10.14.255 NBNS Name query NB WPAD.<00>
30 13.000000 00:00:00:00:00:00 -> 3c:ce:73:39:c6:60 IEEE 802.11 Probe Request, SN=0, FN=0, Flags=........
What to Do Next
You can add additional attachment points, modify the parameters of your capture point, then activate it, or if you want to use your capture point just as it is, you can now activate it.
Note
You cannot change a capture point's parameters using the methods presented in this topic.
Although listed in sequence, the steps to specify values for the parameters can be executed in any order. You can also specify them in one, two, or several lines. Except for attachment points, which can be multiple, you can replace any value with a more recent value by redefining the same option.
In privileged EXEC mode, follow these steps to modify a capture point's parameters.
Before You Begin
A capture point must be defined before you can use these instructions.
Although listed in sequence, the steps to delete parameters can be executed in any order. You can also delete them in one, two, or several lines. Except for attachment points, which can be multiple, you can delete any parameter.
In privileged EXEC mode, follow these steps to delete a capture point's parameters.
Before You Begin
A capture point parameter must be defined before you can use these instructions to delete it.
Deletes all filters defined on capture point (mycap).
Step 2
no monitor capture {capture-name} limit [duration][packet-length][packets]
Example:
Switch# no monitor capture mycap limit duration packet-lenSwitch# no monitor capture mycap limit
Deletes the session time limit and the packet segment length to be retained by Wireshark. It leaves other specified limits in place.
Deletes all limits on Wireshark.
Step 3
no monitor capture {capture-name} file [location] [buffer-size]
Example:
Switch# no monitor capture mycap fileSwitch# no monitor capture mycap file location
Deletes the file association. The capture point will no longer capture packets. It will only display them.
Deletes the file location association. The file location will no longer be associated with the capture point. However, other defined fille association will be unaffected by this action.
Step 4
show monitor capture {capture-name}[ parameter]
Example:
Switch# show monitor capture mycap parameter
monitor capture mycap interface GigabitEthernet1/0/1 in
Displays the capture point parameters that remain defined after your parameter deletion operations. This command can be run at any point in the procedure to see what parameters are associated with a capture point.
What to Do Next
If your capture point contains all of the parameters you want, activate it.
In privileged EXEC mode, follow these steps to delete a capture point.
Before You Begin
A capture point must be defined before you can use these instructions to delete it.
SUMMARY STEPS
1.no monitor capture {capture-name}
2.show monitor capture {capture-name}[ parameter]
DETAILED STEPS
Command or Action
Purpose
Step 1
no monitor capture {capture-name}
Example:
Switch# no monitor capture mycap
Deletes the specified capture point (mycap).
Step 2
show monitor capture {capture-name}[ parameter]
Example:
Switch# show monitor capture mycap parameter
Capture mycap does not exist
Displays a message indicating that the specified capture point does not exist because it has been deleted.
What to Do Next
You can define a new capture point with the same name as the one you deleted. These instructions are usually performed when one wants to start over with defining a capture point.
In privileged EXEC mode, follow these steps to activate or deactivate a capture point.
Before You Begin
A capture point cannot be activated unless an attachment point and a core system filter have been defined and the associated filename (if any) does not already exist. A capture point with no associated filename can only be activated to display. If no capture or display filters are specified, all of the packets captured by the core system filter are displayed. The default display mode is brief.
Note
When using a CAPWAP tunneling interface as an attachment point, core filters are not used, so there is no requirement to define them in this case.
The commands in this table are used to monitor Wireshark.
Command
Purpose
show monitor capture [capture-name]
Displays the capture point state so that you can see what capture points are defined, what their attributes are, and whether they are active. When capture point name is specified, it displays specific capture point's details.
show monitor capture [capture-nameparameter]
Displays the capture point parameters.
show capwap summary
Displays all the CAPWAP tunnels on the switch. Use this command to determine which CAPWAP tunnels are available to use for a wireless capture.
Configuration Examples for Wireshark
Example: Displaying a Brief Output from a .pcap File
You can display the output from a .pcap file by entering:
To avoid high CPU utilization, a low packet count and duration as limits has been set.
Step 2: Confirm that the capture point has been correctly defined by entering:
Switch# show monitor capture mycap parameter
monitor capture mycap interface GigabitEthernet1/0/1 in
monitor capture mycap match ipv4 any any
monitor capture mycap buffer size 100
monitor capture mycap limit packets 100 duration 60
Switch# show monitor capture mycap
Status Information for Capture mycap
Target Type:
Interface: GigabitEthernet1/0/1, Direction: in
Status : Inactive
Filter Details:
IPv4
Source IP: any
Destination IP: any
Protocol: any
Buffer Details:
Buffer Type: LINEAR (default)
Buffer Size (in MB): 100
File Details:
File not associated
Limit Details:
Number of Packets to capture: 100
Packet Capture duration: 60
Packet Size to capture: 0 (no limit)
Packets per second: 0 (no limit)
Packet sampling rate: 0 (no sampling)
Step 3: Start the capture process and display the results.
Step 2: Confirm that the capture point has been correctly defined by entering:
Switch# show monitor capture mycap parameter
monitor capture mycap interface GigabitEthernet1/0/1 in
monitor capture mycap match ipv4 any any
monitor capture mycap file location flash:mycap.pcap
monitor capture mycap limit packets 100 duration 60
Switch# show monitor capture mycap
Status Information for Capture mycap
Target Type:
Interface: GigabitEthernet1/0/1, Direction: in
Status : Inactive
Filter Details:
IPv4
Source IP: any
Destination IP: any
Protocol: any
Buffer Details:
Buffer Type: LINEAR (default)
File Details:
Associated file name: flash:mycap.pcap
Limit Details:
Number of Packets to capture: 100
Packet Capture duration: 60
Packet Size to capture: 0 (no limit)
Packets per second: 0 (no limit)
Packet sampling rate: 0 (no sampling)
Step 3: Launch packet capture by entering:
Switch# monitor capture mycap start
Step 4: After sufficient time has passed, stop the capture by entering:
Switch# monitor capture mycap stop
Note
Alternatively, you could allow the capture operation stop automatically after the time has elapsed or the packet count has been met.
The mycap.pcap file now contains the captured packets.
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# monitor capture mycap start display display-filter "stp"
0.000000 20:37:06:cf:08:b6 -> 01:80:c2:00:00:00 STP Conf. Root = 32768/100/20:37:06:ce:f0:80 Cost = 0 Port = 0x8136
2.000992 20:37:06:cf:08:b6 -> 01:80:c2:00:00:00 STP Conf. Root = 32768/100/20:37:06:ce:f0:80 Cost = 0 Port = 0x8136
2.981996 20:37:06:cf:08:b6 -> 20:37:06:cf:08:b6 LOOP Reply
4.000992 20:37:06:cf:08:b6 -> 01:80:c2:00:00:00 STP Conf. Root = 32768/100/20:37:06:ce:f0:80 Cost = 0 Port = 0x8136
6.000000 20:37:06:cf:08:b6 -> 01:80:c2:00:00:00 STP Conf. Root = 32768/100/20:37:06:ce:f0:80 Cost = 0 Port = 0x8136
7.998001 20:37:06:cf:08:b6 -> 01:80:c2:00:00:00 STP Conf. Root = 32768/100/20:37:06:ce:f0:80 Cost = 0 Port = 0x8136
9.998001 20:37:06:cf:08:b6 -> 01:80:c2:00:00:00 STP Conf. Root = 32768/100/20:37:06:ce:f0:80 Cost = 0 Port = 0x8136
Capture test is not active Failed to Initiate Wireshark
Switch# show monitor capture mycap parameter
monitor capture mycap control-plane both
monitor capture mycap match any
monitor capture mycap file location flash:mycap1.1 buffer-size 90
monitor capture mycap limit duration 10
Switch# monitor capture mycap start display display-filter "udp.port == 20002"
A file by the same capture file name already exists, overwrite?[confirm] [ENTER]
after a minute or so...
Capture mycap is not active Failed to Initiate Wireshark
*Oct 13 15:00:44.649: %BUFCAP-6-ENABLE: Capture Point mycap enabled.
*Oct 13 15:00:46.657: %BUFCAP-6-DISABLE_ASYNC: Capture Point mycap disabled. Rea
son : Wireshark Session Ended
Switch# monitor capture mycap start display display-filter "udp.port == 20002" dump
A file by the same capture file name already exists, overwrite?[confirm]
after a minute or so...
Capture mycap is not active Failed to Initiate Wireshark
*Oct 13 15:00:44.649: %BUFCAP-6-ENABLE: Capture Point mycap enabled.
*Oct 13 15:00:46.657: %BUFCAP-6-DISABLE_ASYNC: Capture Point mycap disabled. Rea
son : Wireshark Session Ended
Step 2: Confirm that the capture point has been correctly defined by entering:
Switch# show monitor capture mycap parameter
monitor capture mycap interface GigabitEthernet1/0/1 in
monitor capture mycap file location flash:mycap.pcap buffer-size 64
monitor capture mycap limit packets 100 duration 60
Switch# show monitor capture mycap
Status Information for Capture mycap
Target Type:
Interface: GigabitEthernet1/0/1, Direction: in
Status : Inactive
Filter Details:
Filter not attached
Buffer Details:
Buffer Type: LINEAR (default)
File Details:
Associated file name: flash:mycap.pcap
Size of buffer(in MB): 64
Limit Details:
Number of Packets to capture: 100
Packet Capture duration: 60
Packet Size to capture: 0 (no limit)
Packets per second: 0 (no limit)
Packet sampling rate: 0 (no sampling)
Step 3: Launch packet capture by entering:
Switch# monitor capture mycap start
A file by the same capture file name already exists, overwrite?[confirm]
Turning on lock-step mode
Switch#
*Oct 14 09:35:32.661: %BUFCAP-6-ENABLE: Capture Point mycap enabled.
Example: Simple Capture and Store of Packets in Egress Direction
This example shows how to capture packets to a filter:
Step 1: Define a capture point to match on the relevant traffic and associate it to a file by entering:
Switch# monitor capture mycap interface Gigabit 1/0/1 out match ipv4 any anySwitch# monitor capture mycap limit duration 60 packets 100Switch# monitor capture mycap file location flash:mycap.pcap buffer-size 90
Step 2: Confirm that the capture point has been correctly defined by entering:
Switch# show monitor capture mycap parameter
monitor capture mycap interface GigabitEthernet1/0/1 out
monitor capture mycap match ipv4 any any
monitor capture mycap file location flash:mycap.pcap buffer-size 90
monitor capture mycap limit packets 100 duration 60
Switch# show monitor capture mycap
Status Information for Capture mycap
Target Type:
Interface: GigabitEthernet1/0/1, Direction: out
Status : Inactive
Filter Details:
IPv4
Source IP: any
Destination IP: any
Protocol: any
Buffer Details:
Buffer Type: LINEAR (default)
File Details:
Associated file name: flash:mycap.pcap
Size of buffer(in MB): 90
Limit Details:
Number of Packets to capture: 100
Packet Capture duration: 60
Packet Size to capture: 0 (no limit)
Packets per second: 0 (no limit)
Packet sampling rate: 0 (no sampling)
Step 3: Launch packet capture by entering:
Switch# monitor capture mycap start
A file by the same capture file name already exists, overwrite?[confirm]
Turning on lock-step mode
Switch#
*Oct 14 09:35:32.661: %BUFCAP-6-ENABLE: Capture Point mycap enabled.
Note
Allow the capture operation stop automatically after the time has elapsed or the packet count has been met. When you see the following message in the output, will know that the capture operation has stopped:
*Oct 14 09:36:34.632: %BUFCAP-6-DISABLE_ASYNC: Capture Point mycap disabled. Rea
son : Wireshark Session Ended
The mycap.pcap file now contains the captured packets.
The Cisco
Support website provides extensive online resources, including documentation
and tools for troubleshooting and resolving technical issues with Cisco
products and technologies.
To receive
security and technical information about your products, you can subscribe to
various services, such as the Product Alert Tool (accessed from Field Notices),
the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS)
Feeds.
Access to
most tools on the Cisco Support website requires a Cisco.com user ID and
password.