How to host ENet server on public IP address

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RedBlueCarrots

I am attempting to follow the High-Level multiplayer tutorial on the godot docs, however I can only get it to work on my LAN. I have found my public IP address and enabled port forwarding on 3 ports

However, when I change the IP address to public and send it to my friend, they are unable to connect to my server. I followed the tutorial exactly and only changed the client’s IP address to the public address.

I haven’t changed the IP address on the server because I can’t figure out how, is this a problem?

Any help would be appreciated

:bust_in_silhouette: Reply From: dustin

your supposed to use the public ip of your router.

the way port forwarding works, is when a packet is sent to your routers public ip, your router will forward that packet to the private ip and if its sent to the correct port. if you understand this, then maybe:

1: you’re using a commonly used port and you need to change it.
2: you’re using two daisy chained routers.
3: you’re not using the correct ports.

if none of what i said helps your problem, sorry, i tried

I’ve gotten the port to over using a different application, just not through godot.

If it adds any clarification when trying to host a server on godot the port does not appear open.

I’m using port 1928, have double checked that it’s right

RedBlueCarrots | 2020-08-16 12:57

you’re supposed to set which ip and port your router will forward in the router settings.

i dont know what application you used to open the port, but its supposed to be in the router settings(put your routers ip in a browser and open the port)

dustin | 2020-08-17 08:04

:bust_in_silhouette: Reply From: RedBlueCarrots

I finally figured out what this is is about 2 weeks later so i figured i’ll post it here in case anyone needs help in the future:

The built in eNet framework, when creating a server, does not need a specific IP on which to run on. It will listen to all available ports on all IP addresses (probably not the correct terminology or explanation but it’s what I’ve deciphered)

Set up port forwarding in your router to redirect traffic to your computer, and make sure your computer has a static IP address

When turning on port forwarding make sure you set it for both TCP and UDP protocols. This was my issue.

Once all these parameters are set up, you should be able to create a server and access it over the internet successfully.

i have the same problem too. I’m using google cloud and net.create_client("",7777). and failed to connect. any solution?

kelvincipta | 2021-12-13 20:47