I'm a bit lost and am experiencing some odd behaviors with the ports on my headless server. In short: I'm expecting to be running my server on default port 34197 but Factorio pingpong servers say I'm hosting on 57021.
For context, I'm using DDNS on my ISPs router which has a port set up as an exposed host which connected to my PFSense firewall, where my Factorio headless server sits behind on a docker container.
I've run across this helpful thread explaining issues running into Outbound Hybrid NAT rules for PFSense. So I went ahead and configured Hybrid Outbound NAT and set my self up with a WAN Firewall rule to allow incoming connections to my server on port 34197
And a screenshot of my Outbound Hybrid NAT rule:
#1

#2

A screenshot of my WAN FW Rule:

Now I'm running into a weird behavior where my server is configured to use the default port, 34197, but the Factorio pingpong servers say I'm hosting on port 57021. While attempting to connect to my server, I can watch the Firewall logs block incoming connections on my WAN interface to 57021. These blocked connections are expected, as I've only configured WAN Rules to allow incoming connections on 34197.
And if it matters at all, this is the docker image I'm pulling from: factoriotools/factorio:stable
Here's the current running logs of the server:
Code: Select all
+++ readlink -f /docker-entrypoint.sh
++ dirname /docker-entrypoint.sh
+ INSTALLED_DIRECTORY=/
+ FACTORIO_VOL=/factorio
+ LOAD_LATEST_SAVE=true
+ GENERATE_NEW_SAVE='"true"'
+ PRESET=
+ SAVE_NAME=
+ BIND=
+ CONSOLE_LOG_LOCATION=
+ mkdir -p /factorio
+ mkdir -p /factorio/saves
+ mkdir -p /factorio/config
+ mkdir -p /factorio/mods
+ mkdir -p /factorio/scenarios
+ mkdir -p /factorio/script-output
+ [[ ! -f /factorio/config/rconpw ]]
+ [[ ! -f /factorio/config/server-settings.json ]]
+ [[ ! -f /factorio/config/map-gen-settings.json ]]
+ [[ ! -f /factorio/config/map-settings.json ]]
++ find -L /factorio/saves -iname '*.tmp.zip' -mindepth 1
++ wc -l
+ NRTMPSAVES=0
+ [[ 0 -gt 0 ]]
+ [[ '' == \t\r\u\e ]]
+ //docker-dlc.sh
Disable mod elevated-rails for DLC
Disable mod quality for DLC
Disable mod space-age for DLC
+ EXEC=
++ id -u
+ [[ 0 == 0 ]]
+ usermod -o -u 845 factorio
usermod: no changes
+ groupmod -o -g 845 factorio
+ chown -R factorio:factorio /factorio
+ EXEC='runuser -u factorio -g factorio --'
+ [[ -f /bin/box64 ]]
+ sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
++ find -L /factorio/saves -iname '*.zip' -mindepth 1
++ wc -l
+ NRSAVES=1
+ [[ "true" != true ]]
+ [[ 1 == 0 ]]
+ [[ "true" == true ]]
+ FLAGS=(--port "$PORT" --server-settings "$CONFIG/server-settings.json" --server-banlist "$CONFIG/server-banlist.json" --rcon-port "$RCON_PORT" --server-whitelist "$CONFIG/server-whitelist.json" --use-server-whitelist --server-adminlist "$CONFIG/server-adminlist.json" --rcon-password "$(cat "$CONFIG/rconpw")" --server-id /factorio/config/server-id.json --mod-directory "$MODS")
++ cat /factorio/config/rconpw
+ '[' -n '' ']'
+ '[' -n '' ']'
+ [[ true == true ]]
+ FLAGS+=(--start-server-load-latest)
+ exec runuser -u factorio -g factorio -- /opt/factorio/bin/x64/factorio --port 34197 --server-settings /factorio/config/server-settings.json --server-banlist /factorio/config/server-banlist.json --rcon-port 27015 --server-whitelist /factorio/config/server-whitelist.json --use-server-whitelist --server-adminlist /factorio/config/server-adminlist.json --rcon-password je2Ohxiw7vi6ahz --server-id /factorio/config/server-id.json --mod-directory /factorio/mods --start-server-load-latest
0.000 2025-03-03 19:22:45; Factorio 2.0.32 (build 81349, linux64, headless, space-age)
0.000 Operating system: Linux
0.000 Program arguments: "/opt/factorio/bin/x64/factorio" "--port" "34197" "--server-settings" "/factorio/config/server-settings.json" "--server-banlist" "/factorio/config/server-banlist.json" "--rcon-port" "27015" "--server-whitelist" "/factorio/config/server-whitelist.json" "--use-server-whitelist" "--server-adminlist" "/factorio/config/server-adminlist.json" "--rcon-password" <private> "--server-id" "/factorio/config/server-id.json" "--mod-directory" "/factorio/mods" "--start-server-load-latest"
0.000 Config path: /opt/factorio/config/config.ini
0.000 Read data path: /opt/factorio/data
0.000 Write data path: /factorio [214259/243172MB]
0.000 Binaries path: /opt/factorio/bin
0.011 System info: [CPU: Intel(R) Core(TM) i5-6600T CPU @ 2.70GHz, 4 cores, RAM: 31971 MB]
0.011 Environment: DISPLAY=<unset> WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=<unset> XDG_SESSION_DESKTOP=<unset> XDG_CURRENT_DESKTOP=<unset> SDL_VIDEODRIVER=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
0.012 Running in headless mode
0.012 Audio is disabled
0.013 Info ModManager.cpp:444: FeatureFlag expansion-shaders = false
0.013 Info ModManager.cpp:444: FeatureFlag freezing = false
0.013 Info ModManager.cpp:444: FeatureFlag quality = false
0.013 Info ModManager.cpp:444: FeatureFlag rail-bridges = false
0.013 Info ModManager.cpp:444: FeatureFlag segmented-units = false
0.013 Info ModManager.cpp:444: FeatureFlag space-travel = false
0.013 Info ModManager.cpp:444: FeatureFlag spoiling = false
0.017 Loading mod core 0.0.0 (data.lua)
0.033 Loading mod base 2.0.32 (data.lua)
0.212 Loading mod base 2.0.32 (data-updates.lua)
0.276 Checksum for core: 544741660
0.276 Checksum of base: 183736295
0.505 Prototype list checksum: 2902124721
0.538 Info PlayerData.cpp:66: Local player-data.json available, timestamp 1741029693
0.538 Info PlayerData.cpp:73: Cloud player-data.json unavailable
0.540 Factorio initialised
0.540 Info AuthServerConnector.cpp:616: Performing TLS check.
0.540 Info HttpSharedState.cpp:55: Downloading https://auth.factorio.com/tls-check/success
0.902 Info AuthServerConnector.cpp:641: TLS check success.
0.902 Info HttpSharedState.cpp:55: Downloading https://auth.factorio.com/api-login?api_version=6
1.799 Info AuthServerConnector.cpp:201: Got token from auth server for username(Jimlo).
1.803 Info ServerSynchronizer.cpp:20: nextHeartbeatSequenceNumber(0) initialized Synchronizer nextTickClosureTick(0).
1.803 Info ServerMultiplayerManager.cpp:806: updateTick(18446744073709551615) changing state from(Ready) to(PreparedToHostGame)
1.803 Info ServerMultiplayerManager.cpp:806: updateTick(18446744073709551615) changing state from(PreparedToHostGame) to(CreatingGame)
1.803 Loading map /factorio/saves/_autosave1.zip: 630400 bytes.
1.814 Loading level.dat: 803003 bytes.
1.820 Info Scenario.cpp:153: Map version 2.0.32-0
1.840 Blueprint storage "blueprint-storage-2.dat" was not found, trying to load previous version storage "blueprint-storage.dat"
1.841 Loading script.dat: 1195 bytes.
1.845 Checksum for script __level__/control.lua: 522968567
1.846 Info UDPSocket.cpp:32: Opening socket at (IP ADDR:({0.0.0.0:34197}))
1.846 Hosting game at IP ADDR:({0.0.0.0:34197})
1.846 Info HttpSharedState.cpp:55: Downloading https://auth.factorio.com/generate-server-padlock-2?api_version=6
2.195 Info AuthServerConnector.cpp:108: Obtained serverPadlock for serverHash () from the auth server.
2.195 Info ServerMultiplayerManager.cpp:806: updateTick(713) changing state from(CreatingGame) to(InGame)
2.214 Info ServerRouter.cpp:664: Asking pingpong servers (pingpong1.factorio.com:34197, pingpong2.factorio.com:34197, pingpong3.factorio.com:34197, pingpong4.factorio.com:34197) for own address
2.214 Info UDPSocket.cpp:44: Opening socket for broadcast
2.215 Error InterruptibleStdioStream.cpp:60: Got EOF on stdin; closing
2.215 Info RemoteCommandProcessor.cpp:126: Starting RCON interface at IP ADDR:({0.0.0.0:27015})
2.215 Info CommandLineMultiplayer.cpp:288: Maximum segment size = 100; minimum segment size = 25; maximum-segment-size peer count = 10; minimum-segment-size peer count = 20
2.332 Info ServerRouter.cpp:547: Own address is IP ADDR:({77.12.11.95:57021}) (confirmed by pingpong1)
2.349 Info ServerRouter.cpp:547: Own address is IP ADDR:({77.12.11.95:57021}) (confirmed by pingpong3)
2.482 Info ServerRouter.cpp:547: Own address is IP ADDR:({77.12.11.95:57021}) (confirmed by pingpong4)
2.674 Info MatchingServer.cpp:123: Matching server game `20760104` has been created.
2.682 Info ServerMultiplayerManager.cpp:738: Matching server connection resumed