In Wireshark on Ubuntu's GNOME desktop, a permanent coloring rule gives matching packets a distinct background in the packet list. For example, coloring DNS replies makes them easier to spot among the queries and other traffic in the same capture.

A coloring rule uses the same expression syntax as a display filter. Wireshark checks enabled rules from top to bottom and uses the colors from the first match, so a broad rule can hide the colors of a more specific one.

Wireshark saves permanent rules in the active configuration profile and loads them again when it starts. The same capture can look different under another profile.

Steps to create a Wireshark packet coloring rule:

On Ubuntu's GNOME desktop, start with a saved capture open in Wireshark's Default profile as installed, with Colorize Packet List enabled and no display filter applied. Use a capture that contains examples of the traffic you want to highlight alongside other packets. The pictured capture, web-traffic.pcapng, contains DNS queries and replies.

  1. Choose Coloring Rules… from the View menu.
  2. Click the green + button to add a rule at the top of the list.
  3. Enter the display filter for the packets you want to color in the new row's Filter field, such as dns.flags.response == 1 for DNS replies.
  4. Press Enter to commit the filter when the field turns green.
  5. Double-click New coloring rule in the Name column.
  6. Type a name that identifies the matching traffic, such as DNS replies, in place of the selected name.
  7. Press Enter to commit the name.
  8. Click Background below the rule list.
  9. Choose a background swatch that contrasts with the rule's text color and the surrounding rows, such as the pale yellow swatch in the top row.
  10. Click Select to use the chosen swatch.
  11. Click OK to save the enabled rule in the active profile.
  12. Press Ctrl+Q to quit Wireshark once the packet list shows the new color.
  13. Click Activities in the top-left corner of the GNOME desktop.
  14. Type Wireshark in Activities to find the app.
  15. Open Wireshark from the Activities search results.
  16. Double-click the same capture under Open on the Wireshark welcome screen.
  17. Confirm that unselected matching packets in the reopened packet list still have your chosen background alongside packets in their usual colors.

    In web-traffic.pcapng, DNS replies 2 and 4 are yellow, while queries 3 and 5 stay blue. The status bar shows Packets: 26.

Share this guide