Page 1 of 1

[Solved] conflicting address

Posted: Sun Feb 10, 2019 5:46 am
by adam_bise
I have a server running 2 headless instances. The one I'm having trouble with is public, on port 34197. I can connect to this instance from the internet directly with the IP address and port, but when using the public server browser it says unable to connect.

The log suggests a possible NAT issue.. here is a snip

2.077 Info ServerRouter.cpp:596: Asking pingpong servers (pingpong1.factorio.com:34197, pingpong2.factorio.com:34197) for own address
2.103 Info UDPSocket.cpp:39: Opening socket for broadcast
2.123 Error InterruptibleStdioStream.cpp:54: Reading stdin failed
2.261 Warning ServerRouter.cpp:487: Received own adddress message reply with conflicting address (got IP ADDR:({47.223.149.44:12127}), expected IP ADDR:({47.223.149.44:4749}))
2.261 Warning ServerMultiplayerManager.cpp:592: Determining own address has failed. Best guess: IP ADDR:({47.223.149.44:4749})

I dont know where it is getting 12127 or 4749. The IP address is right, but the port should be 34197.

I use pfsense and am forwarding the port using NAT.

Here is the NAT config:

<source>
<any></any>
</source>
<destination>
<network>wanip</network>
<port>34197</port>
</destination>
<protocol>udp</protocol>
<target>192.168.1.20</target>
<local-port>34197</local-port>
<interface>wan</interface>

And firewall rule:
<source><any></any></source>
<interface>wan</interface>
<protocol>udp</protocol>
<destination>
<address>192.168.1.20</address>
<port>34197</port>
</destination>

The WAN interface has only 1 IP address

Any ideas?

Re: conflicting address

Posted: Sun Feb 10, 2019 6:16 am
by Zavian
viewtopic.php?f=49&t=53992#p317107

(HanziQ was a factorio developer when he posted that).

Re: conflicting address

Posted: Sun Feb 10, 2019 6:21 am
by adam_bise
I guess I dont understand why the server is trying to figure out what port it's on when it is specified in the config, except if the local port and NAT port are different.

But why can't we specify the NAT port to announce to the server list?

Re: conflicting address

Posted: Sun Feb 10, 2019 6:45 am
by adam_bise
Hey thanks! I found a post in the links from your reply about pfsense port randomization and followed the guidance here and now it gets the right port in the reply.

Re: conflicting address

Posted: Sun Feb 10, 2019 6:46 am
by Zavian
Because somewhere between your server and the internet there is a router that is performing NAT, and changing the port number based on the IP address of the outgoing packet. So no matter what port factorio tries to use, the router will map that to a different port for every IP address that the server attempts to communicate with.

If your static port forwarding rule was working (and no other routers are performing NAT), then both pingpong servers would report the same ip:port, and there would be no problem. Since they are reporting different port numbers, that means a router is changing the outgoing port for every different outgoing ip address, and factorio has no way to know what port to tell a client to connect to. Hopefully the Steam networking support coming in 0.17 will provide another solution.

EDIT: Glad you got it solved.