Need to change NAT settings after restart of server

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.
Gornil
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Nov 19, 2024 3:49 pm
Contact:

Need to change NAT settings after restart of server

Post by Gornil »

Hi,

I've setup a headless server for me and some friends. When a new patch for Factorio is released I need to restart my docker container to get the new Factorio server. And sometimes I get a new external port I need to forward through my router. I need to go into the log file and look for the port it confirms on and add that to the NAT. Is there a way I can set this port permanently?

5.774 Info ServerRouter.cpp:547: Own address is IP ADDR:({xxx.xxx.xxx.xxx:54371}) (confirmed by pingpong1)
5.791 Info ServerRouter.cpp:547: Own address is IP ADDR:({xxx.xxx.xxx.xxx:54371}) (confirmed by pingpong3)
5.974 Info ServerRouter.cpp:547: Own address is IP ADDR:({xxx.xxx.xxx.xxx:54371}) (confirmed by pingpong4)

NB: I'm running Factorio Server manager and running server viewable in the Factorio MP server list.
Atraps003
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Jan 04, 2018 6:34 am
Contact:

Re: Need to change NAT settings after restart of server

Post by Atraps003 »

Factorio default port is udp 34197
Gornil
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Nov 19, 2024 3:49 pm
Contact:

Re: Need to change NAT settings after restart of server

Post by Gornil »

I have opened my router for port 34197, but from the Factorio server logs, it seems like it randomizes the public port for some reason... Because of new patch I had to restart my server, and again I got a new port I had to NAT. Why cant I find any resource for why this is happening? Why does it only seem to be happening to my server?
User avatar
Khazul
Fast Inserter
Fast Inserter
Posts: 199
Joined: Fri Sep 03, 2021 4:47 am
Contact:

Re: Need to change NAT settings after restart of server

Post by Khazul »

Add

Code: Select all

--port 12345

to the command line.

There is also a 'port' property in ..\config\config.ini.
Gornil
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Nov 19, 2024 3:49 pm
Contact:

Re: Need to change NAT settings after restart of server

Post by Gornil »

Khazul wrote: Sun Dec 22, 2024 4:33 pm Add

Code: Select all

--port 12345

to the command line.

There is also a 'port' property in ..\config\config.ini.
Thank you for your reply. I can see from my config.ini files that the port is set to 34197. Should this port be defined somewhere else as well?
User avatar
Khazul
Fast Inserter
Fast Inserter
Posts: 199
Joined: Fri Sep 03, 2021 4:47 am
Contact:

Re: Need to change NAT settings after restart of server

Post by Khazul »

Use whichever suits you best. I use the command line option only on my server.
Post Reply

Return to “Technical Help”