AVSystem / Anjay

C implementation of the client-side OMA LwM2M protocol
Other
188 stars 68 forks source link

Try demo with IPv6 server address #25

Closed edmont closed 5 years ago

edmont commented 5 years ago

How to specify an IPv6 server address for the demo arguments? The use of coap://[addr]:5683 doesn't seem to work properly.

dextero commented 5 years ago

./demo -u 'coap://[2001::1]:5683' is supposed to work (single quotes are probably not necessary for bash, but they are for zsh). I did a quick check, and both an IPv6 loopback address (::1) and a manually assigned 2001::1 worked fine on Ubuntu 18.10 and a local server.

Could you give some more details on what goes wrong?

  1. Are any error messages displayed?
  2. What IP address are you trying to use? Anjay is currently not able to parse IPv6 link-local addresses with interface name specified (fe80:*%INTERFACE).
  3. What is the exact command you run that does not work, and on what OS did you try it? This will be a big help in reproducing the problem.
edmont commented 5 years ago

Thanks for your response @dextero.

I was effectively using a link-local address. By the moment I can manage to test my server in IPv4, but any workaround for accepting IPv6 link-local addresses?

dextero commented 5 years ago

As a workaround, you may use socat to create a tunnel between a non-link-local endpoint (e.g. [::1]:1234) and the target link-local address:

# on terminal 1:
socat UDP6-LISTEN:1234,fork "UDP6:[$TARGET_IPv6_LINK_LOCAL_ADDRESS]:5683"

# on terminal 2:
./demo -u 'coap://[::1]:1234'

Will that be good enough for your case?

edmont commented 5 years ago

@dextero I think so, thanks!