Problem with the stability of connections defined in static routing

Hello everyone,

On the main router (LAN: 192.168.1.1/24), I've configured static routing for devices behind their own access router (LAN: 192.168.1.10/24, WAN: 192.168.89.1/24).

If we connect to a specific device (e.g., 192.168.89.2) occasionally, everything works fine.

The problem occurs when there's continuous communication (continuous data reading via ModbusTCP from a server 192.168.89.2 on port 502) with the same device. After several hours of continuous data reading from port 502, connections to the polled server on port 502 begin to multiply, and communication is interrupted and doesn't resume on its own. After disabling communication with this server and waiting for all established connections to its port 502 to close, you can re-enable communication and it will work stably again for several hours.

What's the problem? What could be wrong?

I'm sorry to say, but in this case the fault most likely lies with your device. This is not particularly rare with these sorts of embedded devices.

What you can do is:

  • Lower the tcp established timeout to something sensible like 6 minutes
  • If you have (very likely) a drop invalid rule in your firewall forward chain, disable (or remove) it.