Monitoring multiple ports in tcpdump

后端 未结 3 1164
攒了一身酷
攒了一身酷 2021-02-01 00:36

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

相关标签:
3条回答
  • 2021-02-01 00:52

    if you want to filter ports based on the range then use portrange.

    E.g:

    tcpdump -an portrange 1-25

    0 讨论(0)
  • 2021-02-01 01:03

    You can also select an interface (change -i any to -i en0 for example) and the communication protocol :

    tcpdump -i any 'udp port 1812 or tcp port 1813'

    0 讨论(0)
  • 2021-02-01 01:06
    tcpdump port 80 or port 3128
    

    or, alternatively,

    tcpdump port '(80 or 443)'
    
    0 讨论(0)
提交回复
热议问题