- Home /
NAT Punchthrough Workaround?
Hello, I've been putzing with Unity's NAT Punchthrough stuff and found out that my friend's network is incompatible with mine. I want to make a game where one of the players is the host for two other players to both save money on servers and save time. What sort of work-arounds are there, if any, for Unity's NAT Punchthrough incompatibilities? Do I have to tell players to open certain ports on their firewall?
To be specific...
My Network: ConnectionTesterStatus.LimitedNATPunchthroughPortRestricted
Friend's Network: ConnectionTesterStatus.LimitedNATPunchthroughSymmetric
Answer by whyunoworkunity · Sep 27, 2012 at 10:36 PM
You'll probably need to have players who are hosting games make sure that port forwarding is setup on their router if NAT punch through isn't working.
So for example if a player wants to host a game on port 5000, they'll need to have their router forward port 5000 to their machine's IP address. Generally, anyone who is hosting a server needs to have a public IP address or port forwarding setup to allow clients to connect reliably. This is usually sidestepped by modern games by having some kind of third party service that hosts your games for you.
You could try using the Photon Unity Server by Exit Games, but there may be fees / licensing / total concurrent connection restrictions involved with that.
Hi, I am running into the same issue.
The suggestion of using Photon Unity Server, do you mean that it has functions that are alternatives to NAT punchthrough, or using Photon as a third-party service of hosting the games?
So you tried using Photon and ran into the same problem? That's curious, I assumed that Photon would host the game that both clients connect to, thus eli$$anonymous$$ating the need for a direct connection between clients.
Answer by thegreatzebadiah · Apr 16, 2016 at 12:05 AM
Hi TheNah,
I just recently released a plugin on the asset store that handles NAT punch-through and automatic port forwarding. It is a really easy to use drop-in solution that requires almost no code modifications. All you really need to do is call StartHostAll() and StartClientAll() instead of the normal StartHost() and StartClient() calls.
Using the plugin you will be able to connect to hosts behind a router no problem without any manual port forwarding needed.
Check it out on the asset store or take a look at the documentation.
Your answer
Follow this Question
Related Questions
What could be causing error: "Receiving NAT punchthrough attempt from target ############ failed" 0 Answers
Receiving NAT punchthrough attempt from target 684547167205435679 failed.. 1 Answer
How to solve networking issues? 0 Answers
Custom master server 0 Answers
Networking Tutorial connect online with NAT punchthrough problem 0 Answers