Page 1 of 1

Need to change NAT settings after restart of server

Posted: Tue Nov 19, 2024 3:54 pm
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.

Re: Need to change NAT settings after restart of server

Posted: Tue Nov 19, 2024 6:28 pm
by Atraps003
Factorio default port is udp 34197

Re: Need to change NAT settings after restart of server

Posted: Sun Dec 22, 2024 3:16 pm
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?

Re: Need to change NAT settings after restart of server

Posted: Sun Dec 22, 2024 4:33 pm
by Khazul
Add

Code: Select all

--port 12345

to the command line.

There is also a 'port' property in ..\config\config.ini.

Re: Need to change NAT settings after restart of server

Posted: Sun Dec 22, 2024 10:04 pm
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?

Re: Need to change NAT settings after restart of server

Posted: Sun Dec 22, 2024 10:33 pm
by Khazul
Use whichever suits you best. I use the command line option only on my server.