How to connect two Modbus TCP Master devices?

Data exchange between two Modbus master devices requires a gateway that can support a master-master mode.

For the data exchange between two master devices, MGate 5109 is required. It supports a master-master mode. In this mode, the gateway will work as a slave device for both sides. One master device can record data on the gateway internal memory, the other one can, thus, receive it ensuring communication.

How to connect two Modbus TCP Master devices?