Closed ihidchaos closed 4 years ago
It seems there's no global IPv6 address configured on your Thread device. Try enabling the following:
CONFIG_OPENTHREAD_SLAAC=y
for IPv6 autoconfiguration based on the global prefix distributed by the BR,CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=6
to increase maximum IPv6 address per Zephyr network interface. The default value is so finetuned that it was needed in my case.This configuration works for me, I was able to ping Google's DNS server with the echo sample (I've used echo_server to avoid additional noise from the app):
uart:~$ net ping 64:ff9b::0808:0808
PING 64:ff9b::0808:0808
8 bytes from 64:ff9b::808:808 to fd11:22::e5c4:9c5b:8473:bb32: icmp_seq=0 ttl=124 rssi=0 time=40 ms
8 bytes from 64:ff9b::808:808 to fd11:22::e5c4:9c5b:8473:bb32: icmp_seq=1 ttl=124 rssi=0 time=41 ms
8 bytes from 64:ff9b::808:808 to fd11:22::e5c4:9c5b:8473:bb32: icmp_seq=2 ttl=124 rssi=0 time=39 ms
According to the configuration you mentioned, I used echo_server and added the two configuration into overlay-ot.conf, and tried again. But it still doesn't work.
It seems that Zephyr still cannot get On-Mesh-Prefix Addres from OTBR.
OTBR:
Nordic Client: success
Zephyr echo_server: failed
Did you run a clean build? I don't know why, but OpenThread does not seem to catch up with changes in config files if there's already an old build present.
It might also be the case, that the SLAAC option is disabled for the prefix you distribute (I don't know your BR configuration, in OTBR it's enabled), so you might need to use DHCPv6 instead (enabled with CONFIG_OPENTHREAD_DHCP6_SERVER=y
). But I've never used this variant to be honest.
Thank you! The problem is solved.
When I execute the following command
cd build
rm -rf *
cmake -GNinja -DBOARD=nrf52840dk_nrf52840 -DOVERLAY_CONFIG=overlay-ot.conf ..
ninja
west flash
it became normal.
And to me, enabling
CONFIG_OPENTHREAD_DHCP6_SERVER=y
alone without SLAAC seems to have no effect.
In addition I found that in my case,
CONFIG_OPENTHREAD_SLAAC=y
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=6
must be enabled together, otherwise my board is only visible to get the address, but can not access the Internet.
when all default:
no ip from otbr
when only enable slaac:
got ip but no internet access
when enable both:
got ip and ping ok
Yes, you need both options. CONFIG_OPENTHREAD_SLAAC=y
is needed to allow OpenThread itself to configure the global address. But OpenThread needs also to register the address on a network interface, that's why you need to increase
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT
, otherwise the address fails to register and Zephyr cannot use it.
It might also be wise to disable statically configured IPv6 address if you don't need it with CONFIG_NET_CONFIG_MY_IPV6_ADDR=""
. We only set it in the samples to make them work out of the box with each other, but in general this shall not be done (and the truth is it's kind of hacky solution for OpenThread).
Can we close the issue then?
Yes, thank you very much for your help!
Describe the bug I have an openwrt-based border router with Internet access.
There is also nrf52840 dk with panid and channel set up and added to the border router network, thread role is router.
When I use echo_lient or lwm2m_client, I can only ping the ip address of the wpan0 interface of the border router, but cannot ping the external public network address, such as google dns.
But when I use the thread client officially provided by openthread or nordic, I can successfully ping Google dns.
Do I need other additional configuration?
My environment:
openwrt:
border router:
I don't have a native ipv6 environment, so I configured nat64 and dns64.
nat64: tayga
dns64: totd
The internet:
To Reproduce Steps to reproduce the behavior:
Expected behavior i wang to ping from nrf52840 board to pulbic web such as google dns
Impact What impact does this issue have on your progress (e.g., annoyance, showstopper)
Logs and console output
when using zephyr and lwm2m_client
when using nordic offical client:
Environment (please complete the following information):
Additional context Add any other context about the problem here.