I have problems getting a global unicastIPv6 address for given RIOT examples on gcoap and nanocoap_server.
The output looks slightly different to the given examples and there is no scope global address given:
main(): This is RIOT! (Version: 2020.10-devel-326-gd187e8-HEAD)
RIOT nanocoap example application
Waiting for address autoconfiguration...
Configured network interfaces:
Iface 5 HWaddr: 56:96:42:41:9E:A3
L2-PDU:1500 MTU:1500 HL:64 Source address length: 6
Link type: wired
inet6 addr: fe80::5496:42ff:fe41:9ea3 scope: link VAL
inet6 group: ff02::1
inet6 group: ff02::1:ff41:9ea3
It seems that there is no IPv6 connection to the router.
By using an Arduino MKR1000 it properly connects to the WiFi
[atwinc15x0] WiFi connected
but there is no network layer connection, just the hardware address seems to be exchanged.
What board are you using? Nvm, I didn’t read your post properly the first time. So you’re using the Arduino MKR1000 to connect to your router over Wifi, is that correct?
I think you’ll need to configure the global address manually using ifconfig from the RIOT shell. With the gcoap example, ifconfig 6 add 2001:db8::1 should add global address 2001:db8::1 to interface 6 of the RIOT node/board. Other than that, your router must have ipv6 enabled too.
How do you create tap0? Does tap0 has a global address defined to it?
When using the tapsetup script ( RIOT/dist/tools/tapsetup/tapsetup), I managed to send a request using tapbr0 with the scope link address. For the scope global address I need to add a global ipv6 address to the tapbr0 interface first.
This is how I tested locally:
# RIOT shell
> ifconfig 6 add 2001:db8::1
> ifconfig
ifconfig
Iface 6 HWaddr: C6:60:20:A2:15:7F
L2-PDU:1500 MTU:1500 HL:64 Source address length: 6
Link type: wired
inet6 addr: fe80::c460:20ff:fea2:157f scope: link VAL
inet6 addr: 2001:db8::1 scope: global VAL
inet6 group: ff02::1
inet6 group: ff02::1:ffa2:157f
inet6 group: ff02::1:ff00:1
# Local machine
## using scope link
$ coap-client -v6 -N -m get -p 5683 coap://[fe80::c460:20ff:fea2:157f%tapbr0]/riot/board
v:1 t:NON c:GET i:f01b {} [ Uri-Host:fe80::c460:20ff:fea2:157f%tapbr0, Uri-Path:riot, Uri-Path:board ]
v:1 t:NON c:2.05 i:f01b {} [ Content-Format:text/plain ] :: 'native'
native
## add global ipv6 to tapbr0
$ sudo ip -6 a add 2001:db8::2/64 dev tapbr0
## using scope global
$ coap-client -v6 -N -m get -p 5683 coap://[2001:db8::1]/riot/board
v:1 t:NON c:GET i:fd2c {} [ Uri-Path:riot, Uri-Path:board ]
v:1 t:NON c:2.05 i:fd2c {} [ Content-Format:text/plain ] :: 'native'
native
Additionally to that I would also configure radvd. If you configured everything, you are able to send it from anywhere in your network. Not only the host system where the process is running.