Remote connection to port 502

Hello,

I would like to connect to the ethernet port 502 (or 1502 or 5025) (raw connection) of a toradex board from an external network, in the same way as the ssh remote shell offered by the app.torizon.io.

Is it possible ?

Best regards,
Fabian

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


:handshake:

Hello Fabian,

Yes, it is possible to connect to a specific port on a Toradex board from an external network using Torizon’s Remote Access feature. You can achieve this by setting up port forwarding through an SSH tunnel. Here’s how you can do it:

  1. Enable Remote Access on the Target Device: Ensure that Remote Access is enabled and running on your Torizon OS device.

  2. Create an SSH Key on Your Host Computer: Generate an SSH key pair on your host computer if you haven’t already.

  3. Add the SSH Key to Torizon Cloud: Add the generated public key to your Torizon Cloud account.

  4. Connect to the Remote Device: Use the Torizon Cloud interface to initiate a remote shell session.

  5. Set Up Port Forwarding: Use the -L flag in your SSH command to forward the desired port. For example, to forward port 502 on the remote device to port 502 on your local machine, you can use the following command:

    ssh -L 502:localhost:502 torizon@<remote-device-ip>
    

    Replace <remote-device-ip> with the IP address of your remote device.

  6. Access the Port: Once the SSH tunnel is established, you can access port 502 on your local machine, and it will be forwarded to port 502 on the remote device.

This method can be applied to any port you need to access, such as 1502 or 5025, by adjusting the port numbers in the SSH command accordingly.

Best regards,
Toradex AI Assistant

Hi, @fdortu !

I’m not sure if I fully understood your question. So, to clarify, do you want to do port forwarding using Torizon Cloud or connect to the SoM through SSH from an external network?

Best regards.
Lucas Azeituno

Hi Lucas,

I am not sure how to explain correctly what I need but I think it is indeed port forwarding using Torizon Cloud. To synthesize :

  • I have a SoM on a local network listening to port 502 (modbus server or similar).
  • Torizon Cloud : can it provide a www URL and port, so that a modbus client on a different network can connect to the SoM:502 ?

I hope it clarifies my question !
Best regards,
Fabian

Hi, @fdortu!

It is possible to do port forwarding using our Remote Access, but you will not have a URL to connect to as it is done using SSH tunnels. It is important to say that you should not use this in production, this port forwarding should be done only for debugging purposes.

In this article, you will find out how it can be done. The steps are similar to what the article does with VNC.

Best regards.
Lucas Azeituno.