1

I am launching an application which broadcasts udp packets. I also have a simple python script to confirm that these packets are being broadcast:

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(('225.0.0.10', 1060))

while True:
    message,source = sock.recvfrom(4096)

However, I wish to see these packets using tcpdump but no matter what I try I cant see them. For example, I have tried:

sudo tcpdump -nnXi any > ~/out.txt
sudo tcpdump -nnXi any port 1060 > ~/out.txt
sudo tcpdump -n udp dst port 1060  > ~/out.txt

The two last command give me empty logs. What am I doing wrong?

0

With tcpdump, you must specify the interface to lsiten on, for instance:

  sudo tcpdump -i eth0 -n udp

or likelwise with wlan0 replacing eth0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.