Multiple Modbus RTU Gateways Using a Single Public IP


Thread Starter


Dear forum,

What protocol should the 'modbus RTU to ethernet' gateways support so I can address and read from multiple gateways under a single router with a single public IP address?

Thank you in advance.

Do you already have Modbus RTU to Ethernet gateways installed, or do you have Modbus RTU devices and need a way to access them from the internet?

If it is the latter, then I would suggest using a single Modbus/TCP to Modbus RTU router. The router will allow you to access all Modbus RTU devices at a single IP address, using the Unit Identifier field of the Modbus/TCP packet to address each Modbus RTU device.
Thank you for your reply,

I understand that the gateway, at the RTU side, is a modbus master requesting registers data from RTU slaves.

But on the ethernet side, how can my software access from the internet multiple gateways and request data if the gateways under one router with one public ip?

If there is a situation where 2 buildings, and in each building, there is a Modbus RTU to ethernet gateway connected to Modbus RTU serial devices. Can i connect both gateways to one router and read from each gateway by itself from the internet?
If you use a Modbus/TCP to Modbus RTU router, gateways are not needed. The router takes the place of all Modbus RTU to Ethernet gateways.

For example, say you have 10 Modbus RTU devices on a RS-485 network that are at addresses 1 - 10. You install a Modbus/TCP to Modbus RTU router onto the RS-485 network and connect the Ethernet port of the router to the internet. Your software (acting as a Modbus/TCP master) can send a Modbus/TCP request to the public IP address of the router and by setting the Unit Identifier field in the Modbus/TCP packet to the address of the Modbus RTU device you wish to target (i.e. 1 - 10), you can access all 10 Modbus RTU devices using that single IP address.

If you have 2 buildings, each with their own Modbus RTU network, you would likely need to have 2 routers and 2 public IP addresses (each router would have its own public IP address). However, if you connect the RS-485 networks in each building together (either by physically wiring the buildings' RS-485 networks together or by using a RS-485 to Ethernet converter to create a TCP/IP connection to tunnel serial communications between the buildings), you could use a single router with a single public IP address.

Keep in mind that a router simply forwards request/response payloads from Ethernet to/from RS-485, stripping or adding TCP headers, CRC's, etc. where needed. A gateway, on the other hand, must have each of its ports configured (one as a master, the other as a slave), each register must be explicitly mapped on each port, and data is typically cached in an internal database on the gateway.
Dear jschulze,

Sorry for the late reply.

I think it s better to wire both rs-485 networks physically. It's less complicated and should do the job, and if i needed more than 31 devices, i'll use repeaters.

Thank you for your help.