Cannot connect to server from game list (Understanding Port Forwarding)

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
octorok
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Feb 23, 2017 10:34 pm
Contact:

Cannot connect to server from game list (Understanding Port Forwarding)

Post by octorok »

I am trying to host a Factorio game on the cloud, and having some networking problems. I think I
understand what the root cause is, but wanted to double check my understanding and ask a few
questions.

Symptoms

I have my Factorio server running on the cloud (specifically using an Azure Container Instance) and
generally things are working.
  • I can join a game by connecting directly to the instance's IP address.
  • The game appears in the "Browser public games" list.
The problem is that I cannot actually connect from the public games listing. Moreover, the "ping"
value never changes from "calculating". (But again, if I connect directly via IP address it works
fine.)

The Problem (I Think)

My understanding is that the root problem is that my server isn't performing "port forwarding".

When Factorio starts up, it sends a request to pingpong1.factorio.com and friends in order to
figure out the server's IP address. (https://factorio.com/blog/post/fff-143)

Here's a snippet from the Factorio logs, which prints that the supposed IP address for the server
is `104.42.20.63:8194`. However, that isn't the case.

Code: Select all

   3.147 Info ServerRouter.cpp:497: Own address is IP ADDR:({104.42.20.63:8194}) (confirmed by pingpong1)
   3.182 Info ServerRouter.cpp:497: Own address is IP ADDR:({104.42.20.63:8194}) (confirmed by pingpong4)
   3.216 Info ServerRouter.cpp:497: Own address is IP ADDR:({104.42.20.63:8194}) (confirmed by pingpong2)
I can connect to the server however if I connect to a different IP address, e.g. `13.86.188.74` (on
which I've opened up the default `34197` port for UDP traffic.)

Questions

So correct me if I am wrong here, but here's what is going on.

The "actual" or "real" IP address and port that Factorio is running on is (in this example) `104.42.20.63:8194`.
(As was reported by pingpong*.factorio.com.)

But Factorio, when trying to contact the server from the "Browser public games" view cannot contact
my server at that IP address and port.

However, if I use that _other_ IP address `13.86.188.74` it works, because whatever router that is
listening to that particular IP address will take care of routing the "public" IP address (`13.86.188.74`)
to the "private" IP address within the network (`104.42.20.63:8194`)... and that is referred to as
"Network Address Translation".

Do I have that right?

If so, then second question, is there any way I can fix this? I noticed there are `--bind` and `--port`
flags that I can pass to Factorio. I've done a little experimentation, and it doesn't look like passing
`--bind 13.86.188.74 --port 34197` will work. (But should it?)

Anyways, I'm not looking for a specific answer since it's specific to the cloud provider I'm using, etc.
But any insight or clarification of what the specific issue here is would be super-helpful. Thanks!

Post Reply

Return to “Technical Help”