ot-br-posix
ot-br-posix copied to clipboard
Use Docker image on bridged or custom docker network
Describe the bug When running OTBR in a docker container as suggested in the official guide Google Home (and other apps) cannot connect to it.
When starting the docker container with:
docker run --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" -p 8080:80 --dns=127.0.0.1 -it --volume /dev/ttyACM0:/dev/ttyACM0 --privileged openthread/otbr --radio-url spinel+hdlc+uart:///dev/ttyACM0
no apps can connect to the border router. However if I execute these command beforehand on the host:
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
sudo sysctl -w net.ipv4.conf.all.forwarding=1
sudo sysctl -w net.ipv6.conf.all.forwarding=1
and then start the container like this
docker run --net=host --dns=127.0.0.1 -it --volume /dev/ttyACM0:/dev/ttyACM0 --privileged openthread/otbr --radio-url spinel+hdlc+uart:///dev/ttyACM0
everything works as expected and apps can connect to the border router. Because I already have a container using port 80 on my host machine I would like to use a custom docker network. I'm not sure how to do that as the Thread communication requires IPv6 and also UDP packets for the DNS discovery.
To Reproduce Follow the Docker tutorial linked above.