2

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?

1

3 Answers 3

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.

0

Try:

tcpdump -n "broadcast and multicast"

0

This works, make sure you use the right interface, eth0 in this example:

tcpdump -i eth0 ether broadcast or ether multicast

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .