enable broadcast traffic relay#243
Conversation
|
I don't seem to be able to get this to work using docker for mac (not tested on Linux) everything seems to build fine but the databox-broadcast-relay exits with an error: |
|
will have a check on this |
|
inside haven't confirmed if the traffic relay works, but the service is not crashing on a linux machine maybe I missed some cases with my regexp for the output on mac? the error means it cannot find an interface whose IP address is |
|
@Toshbrown if I can get a dump of |
|
The ip command is not available on macOS by default. ifconfig is and is already required by the startup scripts. Can you move to using that? The output looks like this on a mac: Or you could do it in the start script and pass it through as an env var like you do with the IP. This might be better as the platform specific stuff wont be berried in OCaml code ;-) |
|
@sevenEng I've just worked out what you were asking for your using the ip command inside the container, sorry. Here is the dump: Because docker for mac is running in a VM it cant see the host interfaces. This will stop broadcast traffic from being seen anyway. So its probably ok just to disable this on macOS maybe display a warning/add a line or to the docs so people know it won't work. (it will be the same no windows or if its runs in VM with NATed networking) |
|
@Toshbrown hi tosh, I pushed a new commit to the bcast branch of core-network: https://github.com/me-box/core-network/tree/bcast, which should not crash for mac now, but I could only test it on my linux machine by giving it a fake nonexistent IP to search for, this is to simulate what happened on a mac machine, where containers only see virtualized interfaces but not the real host's interfaces, if you have time, could you maybe give it a run on your machine to see how things go, thanks! |
| network_mode: "host" | ||
| volumes: | ||
| - '${BCAST_FIFO}:/tmp/relay' | ||
| command: ["-f", "/tmp/relay", "-h", "${BCAST_IP}"] |
There was a problem hiding this comment.
tested by setting BCAST_IP here to an nonexistent IP
on mac, BCAST_IP is the host's IP on the LAN, but from within the container interfaces are all virtualized, such an IP could not be found, which previously would crash the service
|
@sevenEng giving it a test this morning |
|
@sevenEng All seems to work! LGTM |
Set core-network back to master branch after merging me-box/core-network#5
together with changes from core-network#bcast to enable broadcast traffic relay to drivers' and apps' networks
another helper service databox-broadcast-relay will be started together with core-network, the host docker network is attached to this new service's container, this way all the interfaces from the host will be mapped into that container. The relay utility within the new service's container will choose the interface whose IP matches the value given to
-hto listen, and only relay link local broadcast traffic to the fifo, given by-f.tested by installing tcpdump into a driver, then capturing and comparing the broadcast traffic with those captured from host network