Skip to main content

Remote Access Tunnel

Overview

This tutorial walks through the 5-Tunnel-Mgmt collection — creating a remote access tunnel to a WEDA Node device, waiting for it to establish, and terminating it cleanly when done. Two requests in this collection use automatic polling to track tunnel state.

Prerequisites

Auto-captured Variables

VariableSet byUsed by
tunnelIdCreate TunnelGet Detail, Wait for ESTABLISHED, Terminate, Wait for TERMINATED

Steps

1. List Tunnels with Pagination

Lists all tunnel sessions for the current device, sorted by creation time (newest first).


2. Create Tunnel

Opens a new remote access tunnel session to the device. Fill in the request body with the tunnel type and target port before sending.

  • API: Create Tunnel Session
  • Script: tunnelId and deviceId saved to environment automatically
  • Result: 202 Accepted

3. Get Tunnel Detail by ID

Retrieves the current status and connection details for the tunnel stored in tunnelId.


4. Wait for ESTABLISHED Status

Waits until the tunnel reaches ESTABLISHED state and its tunnelEndpoint is available.

Automatic polling — do not click Send repeatedly

After you send this request once, the Postman script takes over. It automatically re-sends the request at a fixed interval until the tunnel status becomes ESTABLISHED. Tunnel creation typically takes a few seconds to a minute depending on network conditions. Just wait — clicking Send again will reset the polling counter.

  • API: Get Tunnel Detail
  • Script: polls until the status is ESTABLISHED and tunnelEndpoint has a value; clears polling variables when confirmed
  • Result: tunnel status = ESTABLISHED with connection information available

Once established, use the connection details in the response to connect to the device via your preferred remote access client.


5. Terminate Tunnel

Closes the tunnel session stored in tunnelId.

note

Always terminate tunnels when you are done. Open tunnels consume connection resources on both the cloud and device sides.

  • API: Terminate Tunnel Session
  • Script: logs termination status and advances state for the next polling request
  • Result: 202 Accepted

6. Wait for TERMINATED Status

Waits until the tunnel is fully closed.

Automatic polling — do not click Send repeatedly

Same behavior as step 4 — the script re-sends the request automatically until the tunnel status becomes TERMINATED.

  • API: Get Tunnel Detail
  • Script: polls until TERMINATED; clears all polling variables when done
  • Result: tunnel status = TERMINATED


Last updated on Jul-16, 2026 | Version 1.1.0