openthread / ot-br-posix

OpenThread Border Router, a Thread border router for POSIX-based platforms.
https://openthread.io/
BSD 3-Clause "New" or "Revised" License
420 stars 232 forks source link

NAT64 not enabled after start with OTBR Docker image #1699

Closed kyberpunk closed 1 year ago

kyberpunk commented 1 year ago

Describe the bug Hello. When I run OTBR Docker image and form the network the NAT64 features are disabled. I'm not sure if it is a bug or intended behavior but I've found following commit which seems to address this problem: https://github.com/openthread/ot-br-posix/commit/9d48a75979dc687254f47e22e1f9b2b028d1ca0d. However, it seems that it doesn't work with Docker image.

To Reproduce I'm running Docker image with RCP design using nrf52840 module. I use following Docker Compose configuration:

otbr:
    image: "openthread/otbr"
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0
      - net.ipv4.conf.all.forwarding=1
      - net.ipv6.conf.all.forwarding=1
    devices:
      - "/dev/ttyACM0:/dev/ttyACM0"
    privileged: true
    command: --radio-url "spinel+hdlc+uart:///dev/ttyACM0"

After forming the network NAT64 communication does not work. When I run state command in OTBR container then NAT64 is disabled:

# ot-ctl nat64 state
PrefixManager: Disabled
Translator: Disabled
Done

Once I enable it by ot-ctl nat64 enable command it works as expected.

I'm using latest Docker image (sha256:84d78a04163b0694a29c7ee1f07b930232c38174ec55f6fd107e9c0a2a625e22) and RCP built with commit 9af0bfa60e373d81a5576b298d6664045870a375.

Expected behavior NAT64 should be automatically enabled after startup (always or optionally). Calling enable command explicitly after container startup is not very feasible. The old setup with tayga was working ok. The behavior probably changed after changing Docker image to build with embedded OpenThread NAT64 support.

sgryphon commented 1 year ago

Please ensure this is optional. Some environments already provide NAT64, and may not want two of them on the network.

And some environments may have border router on an IPv6 only network (e.g. I have this at home), so the machine doesn't even have IPv4, and trying to run NAT64 on it would be a problem. It needs to just route them (like other IPv6) and the upstream NAT64 will handle it.

You still need a way to turn it on when needed (or even default to on if you really want), but there also needs to be a way to turn off when wanted.

erjiaqing commented 1 year ago

This will be fixed by https://github.com/openthread/ot-br-posix/pull/1706