Port forwarding RUT140 with PLC S7-1200 OPCUA

Hi,

I am currently working on a project that involves a Teltonika RUT140 router and a Siemens S7-1200 PLC. I have set up port forwarding to enable access to the PLC via OPC UA (port 4840), but I am encountering issues where the connection is not working as expected.

Could you please help me identify what might be the issue or if any additional configurations are required for the port forwarding to work correctly?

Your guidance would be greatly appreciated. If you need any further details about my setup, I am happy to provide them.

Thank you for your time and support.

@MTBH Hello,

Could you clarify whether you want the RUT device to simply route/forward TCP/IP traffic so you can reach your PLC, or if you need the RUT device to collect OPC UA data and send it periodically to your server?

  • If it’s about routing/forwarding, please share your configuration and explain how you are trying to reach the device. Are you using a public IP address, VPN, or a private APN network?
  • If you need the RUT device to collect and send OPC UA data, we have a configuration example available here: OPC UA Configuration Example.

Kind Regards,

Hi AndrejJ,

I need the RUT device to simply route/forward TCP/IP traffic so I can reach my PLC and read data from it via OPC UA, which will be used for creating my SCADA system.

@MTBH Hi,

Thank you for the information!

Could you share the port-forwarding rule you created?
Have you made any other changes to the device besides setting up port forwarding?

Also, are you using Ethernet WAN or WiFi WAN? If possible, please provide a topology diagram with marked IP addresses and ports to help get a better understanding of your setup.

Kind Regards,

Hi,

In this TRB setup, we are using a SIM card to connect to the internet. Since the IP address provided by the internet provider is dynamic, I created a DDNS (Dynamic DNS) and it is running.

After that, I configured port forwarding from port 8000 to the OPC UA port of the S7-1200 PLC, which in my case is 4840.

In the “Zones” section, I enabled the masquerading option.

In the “Traffic Rules” section, I added a rule to “Open ports on router” for port 8000.

The architecture of our system is as follows: the PLC, HMI, and TRB140 are connected to a switch via Ethernet cables.

I hope this information helps you assist me with my issue.

@MTBH Hello,

A few notes here.

Firstly, I would strongly recommend setting WAN => Accept zone Input to Reject or Drop. If you have a public IP address, this is insecure.

Secondly, you have port-forwarding rule configured correctly (assuming ports and IP is correct). This will work without additional “Traffic Rules”. I recommend deleting the “PLC” traffic rule and restarting firewall/device.

Other than that, the configuration looks ok.

If the issue persists, could you please try enabling remote HTTP access in System → Administration → Access Control and trying to access the RUT itself from the internet using its DDNS? Does it connect?

Kind Regards,

Thank you for your suggestions.

I have changed the WAN settings as you recommended, deleted the “PLC” traffic rule, and enabled remote HTTP access, but I’m still unable to access the TRB from the internet using the DDNS.

Additionally, is it normal for the DDNS IP address and the WAN IP address to be different?


Best regrads.

Hello,

No, those IPs should be the same. If they are different, it likely means your device has either a private IP or a CGNAT IP, which makes it inaccessible from the internet.

Private IP ranges:

10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255

CGNAT IP range:

100.64.0.0 - 100.127.255.255

If your device has an IP from these ranges, you may need to contact your SIM provider to check if a public IP is available. If it is, they will usually provide a specific APN, which you can configure in Network → WAN → edit Mob1s1a1 on your mobile interface.

If a public IP is not an option, you can use a VPN. However, a standard VPN requires a server with a public IP. If this is not available, you can use VPN solutions like RMS VPN Hubs or ZeroTier, which do not require a public IP.

Kind Regards,

Hello,

Thank you for the information.

I will contact the SIM provider and try to get a public IP. Once I have it, I will attempt to connect to the TRB remotely.

Best regrads.

1 Like