Docker Community Forums

Share and learn in the Docker community.

Recieving broadcasts on a user-defined network

Use case: I have 2 machines on the same network (192.168.1.) where one machine (broadcasting machine, last octet 100) is broadcasting UDP packets out on 192.168.1.255. The listening machine (last octet 130) is running the docker stack (started with docker-compose, but with ips like 172.20.0. ) on a user defined network alongside other containers (redis, kafka, elk stack). I need the user defined network on the listening machine since I rely on being able to resolve redis:6379 or kafka:9092 for some of the other containers

listener:
image: udplistener:3.0.0
container_name: listener
ports:
- 5504:5504/udp
depends_on:
- redis
- kafka
external_links:
- elasticsearch
volumes:
- ./server-external:/external:rw
networks:
- test-cloud

Issue: The listening machine does not pick up the broadcast, but when the broadcast is switched to unicast it works. Is there a way to map it so that the host interface (eth0) can bridge the broadcast correctly to the docker0 interface without having to move all the containers onto the host network?