I have the following set-up:

enter image description here

I use 6LOWPAN (IPv6 implementation in IEEE 802.15.4) on my sensor link that have IPv6 addresses (stateless) as aaaa::xx/64

It uses RaspberryPi (RPI) as an edge router (called 6lbr) that is both connected to IEEE 802.15.4 and IEEE 802.11 (it does translation between two standard and routes the packets). RPI runs Debian.

My network doesn't support IPv6 advertisements (RA), so it only assigns a public IPv4 to RPI.

Finally, I store my server code (UDP server/client) on a Debian server that has both public IPv4 and IPv6 addresses.

Question I couldn't figure out how to access sensor nodes from the server side. As an example, What destination address do I need to type in SERVADDR below to send a UDP unicast?

inet_pton(AF_INET6, SERVADDR, &server_addr.sin6_addr);

Does it suppose to be an IPv4 or IPv6 UDP unicast?

I tried to use NAT64 (an open source project called wrapsix) but couldn't manage to access it. What kind of tunneling solution do I need to use? Could you also state an open source project name that I can use for the tunneling or as a broker?

As a second question How would I need to access to the sensor network (aaaa::xx) if my Access Point was allocating a private IPv4 address (192.168.x.x) to wlan0 interface of the RPI? In that case, what kind of solution do I need to use?

EDIT 1 referring @kasperd's comments, I did a better search on IPV6 tunelling. I can't use NAT64 because it requires an unique IPv6 network prefix which I don't have it in my case.

I can't use 6to4 that requires a public IPv4 (considering my second question).

as @kasperd suggested, I should use 6in4 that requires a broker. As I see on the web suggestions, I can use Hurricane Electric or SixXS. They both claim to be free, but couldn't understand what is the main difference. As I understand, I can't use Hurricane Electric's solution behind an IPv4 NAT, but SixXS has a protocol called AYIYA that can be used behind an IPv4 NAT. A disadvantage of this solution is that if I have multiple of similar connectivity issue, I need to configure them individually. Secondly, SixXS allows to use it commercial purpose, however, since it is free, they relay on other organizations that may stop providing to use of the IPv6 addr that one use on his/her project. It creates a reliability consideration. Another consideration is that it might be an issue that some firewalls may not allow 6in4 tunneling.

In addition, Ubuntu/Debian has a packet called Miredo based on Teredo tunneling (based on UDP packets). This solution can be used behind an IPv4 NAT. Furthermore, since it is an UDP based communication, almost all firewalls would allow the tunneling. However, it is said that Teredo is a temporarily solution and should be deactivated (Teredo relays) when IPv6 is more mature to encourage all to use native IPv6.

EDIT 2 SixXS.net don't accept any new sign-ups. I created an account on HE, but it has 5 tunnel limitation. If one needs more than 5 tunnelling, I guess Miredo should be a better option. I tried both HE broker and Miredo that receives the IPv6, but I guess I have a problem with the routing rules that I can't ping that IPv6 from a remote PC.

  • 3
    You shouldn't be squatting on reserved addresses. If you have a routed prefix from your internet provider, then use that. If you don't, then use a tunnel. If your server has a routed prefix, then you can run your own tunnel server. If you have no routed prefix at all, you can run a tunnel with RFC 4193 addresses on the inside. – kasperd Feb 2 '16 at 12:45
  • @kasperd, thanks for the answer. Could you tell me what is the name of the tunnel solution that I should use? I'd appreciate if you could define any project name (e.g., for VPN tunneling -> openVPN) for the tunneling. – Angs Feb 2 '16 at 13:09
  • Do you need a VPN? If you only need the tunnel to resolve your addressing issues, then using VPN may be overkill. You haven't told us anything about how you intend to secure the system, so I can't tell you whether you need VPN. If you don't need VPN, you can just use 6in4. – kasperd Feb 2 '16 at 13:48
  • @kasperd, thank you for the answers, Now it is more clear how I should tunnel the IPv6. I doubt to use SixXS broke or Miredo (based on Teredo) on Debian. Which one would you recommend to use? – Angs Feb 2 '16 at 17:58
  • 1
    Teredo is not suitable in the scenario you have described. SixXS might be suitable, but I never managed to make it through their signup bureaucracy, so I can't tell you. Overall Hurricane Electric is the tunnel provider I have had the best experience with. They only support 6in4, which means you need to run your own 6in4 gateway on a host with a public IPv4 address. – kasperd Feb 2 '16 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.