0

So I am having some issues trying to get two computers to connect using IPv6 addresses. I have an application where two users can connect and send packets to each other using IPv4 addresses (same wifi). However, due to the coronavirus we have been forced to work all over the states. Because of this, I have been trying to switch to using IPv6. Now according to the RakNet documentation, this should be fairly simple. The TLDR is you set the socket family to be using IPv6 and change a Marco in a RakNet header file.

Source.cpp

    RakNet::SocketDescriptor sd(masterServerPort, "");
    sd.socketFamily = AF_INET6;
    RakNet::StartupResult result =  peer->Startup(MAX_CLIENTS, &sd, 1);
    peer->SetMaximumIncomingConnections(MAX_CLIENTS);


    //std::cout << "The master server has started!\n ";
    std::cout << "Result: " << result << "\n";
    std::cout << "Server IP: " << peer->GetLocalIP(0) << "\n";

RakNetDefines.h

#ifndef RAKNET_SUPPORT_IPV6
#define RAKNET_SUPPORT_IPV6 1
#endif

When I run this program the Startup result comes out to SOCKET_FAMILY_NOT_SUPPORTED and no one can connect. This happens when starting the host machine meaning I don't seem to have a host to connect to. Has anyone else run into this issue? I am using Windows 10 which I believe supports IPv6 by default. Could this be a firewall issue? In my opinion, it couldn't be since I am the one starting the server, but this is out of my expertise. I kinda hit a brick wall so any help would be great.

Another solution I have is using NAT punch-through but that would require an external server that cost money (on a very low budget). I'd like to avoid using extern services as much as possible.

Thanks in advance!

  • Voids

Edit: I am making this application in C++ but using the API RakNet to help with the packets. I believe this to be a RakNet issue in my code, but I am open to suggestions.

Edit: I can't even get a host started up properly so no packets between computers are being sent yet.

Voids
  • 19
  • 3
  • You need to have IPv6 from your ISP, and you need to enable IPv6 on any interfaces. – Ron Maupin Mar 27 '20 at 18:56
  • So when I look at my wifi settings it shows IPv6 address and it says it is connected to the internet. Would that mean IPv6 is enabled or is there an extra step I am missing? @RonMaupin – Voids Mar 27 '20 at 18:58
  • I do not know what you are looking at, nor if your ISP provides IPv6. In any case, you are asking on the wrong SE site. This is about a host configuration that should be asked on [su], not the programmer site. – Ron Maupin Mar 27 '20 at 18:59
  • I was under the assumption that this was a programming issue with RakNet and trying to work with the API. I am making the host and client through C++. If you feel that this is still the wrong site, I apologize for the mishap and I will also post on Super User.@RonMaupin – Voids Mar 27 '20 at 19:05
  • Have you tested the IPv6 connectivity? Assuming something like you are assuming would be the wrong thing. Test IPv6 first (ping, traceroute, etc.) to make sure you have IPv6 working. You will also need to deal with firewalls, which default to blocking all outside initiated connections, so you will need to add firewall rules to allow what you want. You do not seem to have taken the steps necessary to get IPv6 running before trying to use it in your application. – Ron Maupin Mar 27 '20 at 19:08
  • So I tested Ipv6 connectivity through Ping-IPv6 on ultratools.com. The ping was successful and Im still having RakNet output SOCKET_FAMILY_NOT_SUPPORTED. I am just trying to get a server up and started using the code above. Would a firewall still block that even though there is not an incoming connection? I am by no means an expert at this, so if there is any other additional setup please let me know. I had temporarily disabled my firewall before running my program and still got the same results.@RonMaupin – Voids Mar 27 '20 at 19:19

0 Answers0