Docker receiving multicast traffic

后端 未结 1 729
清酒与你
清酒与你 2020-12-24 15:16

We have a dockerized server application that is doing auto-discovery of physical appliances on the network by listening for multicast packets on port 6969. So we need our do

相关标签:
1条回答
  • 2020-12-24 15:29

    Try to enable multicast on your nics:

    ip link set eth0 multicast on
    

    echo 1 >/proc/sys/net/ipv4/ip_forward to turn on IP forwarding

    You need to explicitly set or at least check that it is enabled on relevant interfaces.

    net.ipv4.conf.all.mc_forwarding = 1
    net.ipv4.conf.eth0.rp_filter=0
    

    Allow the multicast traffic:

    iptables -I INPUT -d 224.0.0.0/4 -j ACCEPT
    iptables -I FORWARD -d 224.0.0.0/4 -j ACCEPT
    

    Also you might need to add the route for multicast traffic:

    route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 
    

    Change the TTL of the multicast sender:

    iptables -t mangle -A OUTPUT -d <group> -j TTL --ttl-set 128
    Where group is the multicast group address of the stream you want to change the TTL of.
    

    Also you can start multicast proxy

    PS:

    You should try (if above doesn't help) to start docker container with --net=none option and use pipework with follow command:

    pipework docker0 -i eth0 CONTAINER_ID IP_ADDRESS/IP_MASK@DEFAULT_ROUTE_IP 
    

    which creates eth0 interface inside container with IFF_MULTICAST flag and defined IP address.

    0 讨论(0)
提交回复
热议问题