How can I connect to my dedicated server over the internet? (Works locally)

Hello,

I made a simple dedicated server by following the UE 5.2 documentation (using third person template).
I packaged the server and client build, and I am able to connect to my server on one machine using localhost, and also with Hamachi.

If I run the server on one machine, I am not able to connect the client on the other machine.

  • They are both connected to the same Hamachi network (on separate accounts, also tried using separate networks).
  • I disabled Firewall on both devices.
  • When running the server, I am specifying the Hamachi IPv4 address using -ip=(address)
  • The server and client are set to use port 7777.

There is no change in the server logs, it doesn’t even appear to attempt connecting.

Using Hamachi, I should be able to avoid port forwarding right? Why is my client not able to find the server (or the server detect my client), even if they are connected to the same Hamachi network?

Anyone who could please give me some pointers? I am having a hard time finding any information on this. Any help would be greatly appreciated.

Sometimes the firewall is blocking external connections. Try to create the rules for port 7777 (unreal default) in your firewall settings.

How to open firewall port on Windows 10 - Pureinfotech

Thanks for the reply.
I should specify that I tried to disable Windows Firewall entirely on both machines.
I attempted to pass the command-line arguments -ip=(Hamachi IPv4 address) and -port=7777 on both the server and client.
I also tried using a different network (mobile network) for my second machine, both as server and client.

Is the server set to listen on any connection or is specifically listening at say ‘localhost’ instead of listening “globally” at its ip address?

It would seem that it is listening to localhost by default. If I run the server including the command “-ip=” and my Hamachi or internal IPv4, I can connect a client on the same machine, using localhost, Hamachi IPv4, and my interal IP, with port 7777.

My server logs:

“[2023.06.02-20.20.28:820][ 0]LogNet: Created socket for bind address: 0.0.0.0:7777”

After a client joins using <PROJECT_NAME>Client.exe (Hamachi IPv4):7777, it logs:

“[2023.06.02-20.34.26:286][173]LogNet: NotifyAcceptingConnection accepted from: (Hamachi IPv4 / internal IPv4):55740”

(I believe the port changing is intended functionality.)

There is no visible difference if I specify the IP in cmd, when running the server.
Is there another way I should specify what connections the server listens to?
Or is there another way to configure what IP the server is using?

Update: I can even connect to my server using the internal IP address of my computer, but it only works on one machine, even if I enabled port forwarding (tested that it works with a Minecraft server).

I managed to get it working using Advanced Sessions for Steam.
I’ll just mark it as solved for now, but it’s really a workaround from my original intention.
Though, I suppose it’s not too bad for security reasons, such as not needing to directly connect with the IP. It seems to remain hidden when finding sessions. Also, each player must be a valid Steam account, so that’s also good.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.