Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monitoring multiple ports in tcpdump

I am trying to find a way to read multiple ports using tcpdump. Suppose I have two ports, p1 and p2, and I want to read the traffic moving through both ports simultaneously. Is there any way to do it using tcpdump or will I have to use some other tool?

Basically I am running a proxy server which is running on some port. I want to read the traffic moving through this port as well traffic moving through port 80(HTTP).

like image 652
mawia Avatar asked Feb 02 '10 21:02

mawia


People also ask

Can tcpdump capture on multiple interfaces?

You can capture on all three interfaces with "tshark -i 1 -i 2 -i 3".

How do I specify a port in tcpdump?

tcpdump allows you to specify network packets that are either using some port X as source or destination. For example, to capture DNS traffic, you can use port 53 . You could prefix the port keyword with src/dst as src port 53 or dst port 53 and filter it even further.


1 Answers

tcpdump port 80 or port 3128 

or, alternatively,

tcpdump port '(80 or 443)' 
like image 61
caf Avatar answered Oct 27 '22 19:10

caf