Wireshark Display Filters
100%

Network Monitoring · Lesson 4

Wireshark Display Filters

Learn to limit the view of a prepared capture with a Wireshark display filter.

A packet capture can hold many protocols. A display filter tells Wireshark which saved packets to display. It changes what you see while leaving the capture file intact.

Selecting a Protocol

Save the sample capture as sample.pcap. Open it in Wireshark and enter dns in the display filter box. On a Linux terminal with TShark installed, this command applies the same filter to the saved file. The file in this example contains a harmless lookup and separate sample traffic.

$ tshark -r sample.pcap -Y dns

The -r option reads a file and -Y applies a display filter. Look for a query and its response.

The filtered list shows two fewer rows than the original view. What happened to the other packets?

Matching an Address

A filter can also refer to a packet field. ip.addr matches an IPv4 source or destination address. The two equals signs compare the field with the sample value.

$ tshark -r sample.pcap -Y 'ip.addr == 192.0.2.10'

The shell quotes keep the expression together as one argument. You can recognize the endpoints in the displayed rows.

A packet goes to 192.0.2.10 from a different address. Will it match?

Recorded TShark output comparing the DNS-only display with both protocols in the practice capture

Explaining an Empty View

An empty result means the filter found no matching saved packets in the file you examined. Check the expression, time, and capture point before making a broader claim. Start by clearing the filter to confirm the capture contains traffic.

You apply dns to a saved capture and see no rows. What can you report?

Lesson complete

You finished Wireshark Display Filters

You can now filter a saved packet capture and explain the result's scope.

  • Select a protocol with a display filter.

  • Match a packet address with ip.addr.

  • Interpret a filtered view using the file's visibility limits.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Network Monitoring