Search Unity

Netcode for GameObjects cannot host game online

Discussion in 'Netcode for GameObjects' started by Father_F1kus, Nov 8, 2022.

  1. Father_F1kus

    Father_F1kus

    Joined:
    Feb 22, 2015
    Posts:
    5
    Hey,
    Im trying to set up a test project using Netcode for GameObjects.
    Using Unity 2021.3.13f1 and Netcode for GameObjects 1.1.0 w Unity Transport 1.3.0 and using UnityTransport i cannot host a game online. (my public ip is ipv6)
    It works when connecting locally, however hosting a game to clients outside of the network does not work.
    I have tried port forwarding and using DMZ. Neither of which seemed to help.

    Reading through the docs it seems ipv6 should be supported normally from the latest version of Unity Transport.
    My public IP being detected as v6:
    upload_2022-11-8_14-55-7.png
    Using mirror / fishnet / unet is working normally.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,975
    When you say Mirror/FN/Unet are working, did you test them with IPv6 today? Just in case you rely on past experience.

    Are you sure clients entered the host's public IP (correctly)?
    You may want to consider using dynamic DNS (eg No-ip.com) and hostname resolution on the client-side so that clients need not bother with IP addresses respectively cannot make any mistakes entering that cryptographic mess of an address. Also many routers allow setting up DynDNS straight on the router's web interface, so that's super convenient.

    Can you ping the IPv6 address remotely? You may need to configure the router to answer to ping requests.

    Did you try falling back to IPv4?

    DMZ shouldn't be needed, port forwarding suffices (and is more secure, since you do NOT want ALL traffic routed to a specific machine on your network - if that's what you meant by DMZ).

    Make sure you also configure the local (software) firewall such as Microsoft Defender Firewall. For a quick test it would suffice to just disable it. If it starts to work in that case, you can then enable firewall and apply filter changes until it works with firewall enabled. Also antivirus software might be preventing the app from opening ports or receiving network data, usually when the heuristics pop in.
     
    Niter88 and Father_F1kus like this.
  3. Father_F1kus

    Father_F1kus

    Joined:
    Feb 22, 2015
    Posts:
    5
    Hey codeSmile,
    Thanks for the reply!
    i have tested today with a new and old project. I will try dynamic DNS and ipv4 fallback today.
    I have already tried disabling firewall as well and it didn't change anything.
    I’ll post the results if some of your suggestions work out.
    thanks!