Search Unity

  1. Tune in to get all the latest Unity news live from Berlin on June 19, 6pm CEST. Set up a YouTube reminder!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Unity Multiplayer UNET from LAN to WAN

Discussion in 'Multiplayer Networking' started by Edan-Smith, Jun 14, 2018 at 12:54 PM.

  1. Edan-Smith

    Edan-Smith

    Joined:
    Jan 21, 2015
    Posts:
    5
    Hey guys, I'm trying to make my game work in WAN using UNET HLAPI.
    For now, the only way that I was able to make my friend connect to me was by us both using a VPN named "Hamachi" which simulates as if we both were on a LAN.

    So my questions are:
    1 - Do I need to enable the "Bind server to IP" option on NetworkManager?
    2 - If question 1 = yes, should I put the Server/Host external IP in the box that appears after the option is checked? Like "75.398.20.xx" for example.
    3 - Then after all that, the Server/Host has to PortForward with his router + Open ports with TCP/UDP and that is it?
    4 - The port forwarding can be done on the Server/Host router or I do need some 3rd party program like NAT-something installed?

    Current problem: If the server/host tries to host with "Bind server to IP" + their external IP, unity gives an error saying "Cannot open socket on ip {75.398.20.xx} and port {25000}; please check your network, most probably port has been already occupied" even though the port isn't being used and is open.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    2,539
    You need to enable port forwarding on your router to point the correct UDP port(s) used by your game to the internal IP address which will host the game. Or you can use a relay solution. Or you can use a NAT punch through solution. Or you can set up a dedicated server with a public IP address somewhere. There's lots of threads on these various topics. They are more general networking issues than Unity issues though.
     
  3. Edan-Smith

    Edan-Smith

    Joined:
    Jan 21, 2015
    Posts:
    5
    Ok thanks, we managed to fix it doing something else.