+1 vote

I have been using the high-level Godot multiplayer API for networking. I forwarded the port which the server will run on, but my friend cannot join the game. I'm pretty new to networking, can somebody tell me what to do to achieve online servers, or at least steer me in the right direction?

in Engine by (53 points)

2 Answers

0 votes
Best answer

Solution:

Get your local IPv4 address
Linux:
Type ifconfig -a in the terminal, and copy your IPv4 address.

macOS:
Go to your System Preferences->Network and it should say the IP address to the network you connected to.

Windows:
Open your power shell, and type ipconfig. Copy your IPv4 address.

Forward your port
At the top search bar in your browser, type 192.168.0.1 to get to your network settings (on Windows you can find this address under your IPv4 titled Default Gateway).

Warning! This might look different for you. Go to Advanced->Security->Port Forwarding and create new. For the port use the one, which you would use for your game. If you haven't got one, be a funny man and use 6969 both for outside and local. For the IP use your IPv4.

Get your public IP Open a search engine (Google, DuckDuckGo) and search "what's my IP." Below the search bar should give you the results.

Change network properties: If you store your default port and IP in a constant or variable, change the IP to your public IP and the port to the one you just forwarded.

Done.

Optional:

Hide your public IP: On FreeDNS register an account, and create a subdomain. You can name the domain anything you want, and use your public IP (use A-type). Change your game's default IP to the subdomain.

by (53 points)
0 votes

You also need give the right ip. The one showing in here https://www.showmyip.com/
You need port forward on any router in your network also.
Also port forward any software firewall and windows firewall. This can be turned off temporarily.

How does your network look lile?

by (248 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.