Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Tsurugi21 · Jun 22, 2016 at 06:00 AM · networkingnetworkserverclientnat

Connect to remote private IP

Hi! First of all, thanks to anyone who reads this and attempts to help me, it is really appreciated ^^

Second, the actual question: Is there a way to manually connect (Nework.Connect()) to a server (directly to the computer, not its router) if we happen to have the public IP of its router AND the private IP assigned by the router of the server via a custom build master server that saves public IP, private IP and the port of each servers.

I know a NAT facilitor kinda does that, but im trying to stay away from those, since unity's official masterserver and facilitor pretty much never work like intended

tl;dr : How to connect to a specific server with its router IP, its port and its private IP (assigned by the router). Thanks!

-SpectralMemories

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by thegreatzebadiah · Jun 26, 2016 at 12:09 AM

The host will have to forward the port they are hosting on in their router settings.

the client will then be able to connect to the host's public IP on the forwarded port.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tsurugi21 · Jun 26, 2016 at 11:12 PM 1
Share

I understand what you are saying, I know that the hosts must portforward their router for one to connect on their machine using its public IP. $$anonymous$$y question is how to avoid the need to portforward, given the fact that the client knows the private IP (and thus the specific machine) on which it has to connect.

avatar image thegreatzebadiah Tsurugi21 · Jun 26, 2016 at 11:40 PM 0
Share

I created a plugin for just this purpose that you can get on the asset store. It does automatic port forwarding, as well as NAT punchthrough, which will get your players connected even when port forwarding is not an option. Check it out, I think it's exactly what you're looking for: http://u3d.as/qhh

The routes have to be added to the router or it will never let traffic through. Automatic port forwarding will set that up automatically. NAT punchthrough sort of tricks the router into adding the routes.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Trying to store a variable for all clients 0 Answers

Connect Client to Server from a Different project 0 Answers

Unity networking tutorial? 6 Answers

OnConnectedToServer not called when testing on same machine 0 Answers

How connect client to server when ip is private ? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges