This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Filter With Destination Port

0
1

Hello, the IP I am connecting to can change, but it always uses 2 destination ports (for example purposes, 00000 and 11111).

Let me know what to put in the filter list.

asked 08 Apr '15, 13:47

BobTheLawyer's gravatar image

BobTheLawyer
5124
accept rate: 0%

edited 08 Apr '15, 14:12

What type of filter, capture or display?

(08 Apr '15, 14:22) grahamb ♦

Sorry, I'm pretty new. I'm not sure. Here's an image: http://i.imgur.com/PsT3Eyi.png

(08 Apr '15, 14:26) BobTheLawyer

One Answer:

1

OK, that's a display filter, it will affect what is displayed, not what is in the capture file. I asked which one because they have different syntax.

A display filter to filter on certain tcp ports e.g. 1234 and 5678:

(tcp.port == 1234) or (tcp.port == 5678)

adjust the port numbers as you require and replace tcp with udp if that's the protocol in use. You can add as many ports as you wish with extra 'or' conditions.

You can also create a filter by right-clicking on a field in the protocol tree and selecting "Apply as Filter" -> Selected.

See the wiki page on Display Filters for more info and links to other sources of information.

answered 09 Apr '15, 03:09

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

If an answer has solved your issue, please accept the answer for the benefit of other users by clicking the checkmark icon next to the answer. Please read the FAQ for more information.

(09 Apr '15, 04:39) Jaap ♦