I have a service saying it is "broadcasting on 0.0.0.0
" using interface eth0
with sendto()
.
However, when checking the traffic with tcpdump
, it seems like it is broadcasting on the lo
interface, and not on the network. For instance, I see messages like this on the lo
interface, and nothing on the eth0
interface:
22:38:17.814047 IP localhost.14557 > localhost.14540: UDP, length 36
On the same machine as the one running the service, I can see the traffic with netcat by running:
$ netcat -l -u -p 14540
But I don't see this traffic from another machine (actually I am using docker containers).
To verify that the broadcast works between the containers, I run:
$ netcat -l -u -p 54321
on the first container, and:
$ echo "foobar" | netcat -ub 255.255.255.255 54321
I get "foobar" appearing on the terminal of the first container. As far as I understand, this means that I am broadcasting "foobar" over the zero network (0.0.0.0
, same as the one claimed by my service above).
Why does my "foobar" broadcast go on the network (interface eth0) and the service broadcast messages stay local (interface lo
)?