
Give a managed data pipeline a controlled path to a database that has no public IP
A database on a workstation, office server, or homelab is normally unreachable from a managed ETL service because NAT and CGNAT do not provide an inbound route. This guide explains three practical architectures: forwarding the native database protocol through a TCP tunnel, placing an HTTPS data API in front of the data, or using a private mesh connection. We also cover connector compatibility, database preparation, least-privilege access, TLS, verification, operations, and troubleshooting. With Localtonet, the direct TCP design can work without inbound router port forwarding when the ETL connector accepts a custom public hostname and port.
๐ What's in this guide
Why a cloud ETL service cannot directly reach a local database
A managed extract, transform, and load service runs outside the network that contains a local database. The service may know the database software, username, and schema, but it still needs a routable network destination. An address such as 127.0.0.1, 192.168.x.x, or another private address has meaning only inside the relevant machine or private network. It cannot be used as a destination from an unrelated cloud environment.
Conventional NAT makes this separation intentional. A router permits devices on the private network to initiate outbound connections while rejecting unsolicited inbound traffic unless an explicit forwarding rule exists. CGNAT adds another translation layer controlled by the internet service provider. In that situation, configuring the local router alone may not create a usable inbound route because the customer does not control the provider-facing address.
A Localtonet tunnel changes the connection path. Our client runs on a device that can reach the database and establishes an outbound connection to a Localtonet relay server. A TCP tunnel then supplies a public host and port that can forward compatible TCP traffic to the configured local IP address and port. This does not require an inbound router port-forwarding rule, firewall changes for unsolicited internet traffic, a public IP address, or VPN setup.
The resulting data path has several distinct segments. The managed ETL connector opens a connection to the assigned public host and port. The Localtonet relay accepts the tunnel traffic. The already-connected Localtonet client carries it toward the local target. Finally, the database handles authentication, authorization, queries, and any database-native transport security.
Localtonet can provide a network path, but it cannot make an ETL connector support an otherwise unsupported database, database version, authentication method, TLS mode, or change-data-capture configuration. Validate those capabilities with the ETL and database documentation before exposing anything.
Compare TCP tunneling, an HTTPS data API, and private mesh access

The safest design is not always the design with the fewest components. Start with the interface the ETL platform can consume, how much of the database must be available, and whether software can run inside the ETL environment. These factors usually determine whether a native TCP connection, a purpose-built HTTPS API, or a private network is appropriate.
| Access pattern | Best fit | Main advantage | Main constraint |
|---|---|---|---|
| Localtonet TCP tunnel | An ETL connector that supports the native database protocol plus a custom public hostname and port | Preserves the connector's normal database interface without requiring inbound router port forwarding | The public endpoint reaches a sensitive service, so database authentication, TLS, privilege limits, and lifecycle control are essential |
| HTTPS data API | An ETL tool with an HTTP, REST, or custom API connector, especially when only selected datasets should be available | The API can expose narrow operations and return only approved fields rather than presenting the full database protocol | You must build, authenticate, validate, operate, and version the API, including pagination and incremental extraction behavior |
| Private mesh access | An ETL runtime, self-hosted worker, or adjacent agent that can participate in a private network | Keeps access within a private network design and can bridge local LAN resources with granular firewall rules | Many fully managed ETL services do not let customers install a mesh client or add private routes to the hosted connector |
| Extraction agent inside the local network | An ETL vendor that provides a supported on-premises agent or self-hosted worker | The extraction component can initiate outbound communication instead of accepting a direct remote database connection | Availability, security behavior, resource requirements, and supported sources are specific to the selected ETL platform |
When a TCP tunnel is the direct solution
Choose the TCP pattern when the cloud connector expects to speak the database's native wire protocol and accepts a user-supplied host and port. This is often the least disruptive approach because the ETL tool continues to use its existing database connector. Features such as metadata discovery, incremental reads, or change data capture remain connector and database concerns rather than tunnel features.
The direct design is also useful when the database is temporary, the pipeline is being evaluated, or the source exists on a network where inbound forwarding cannot be configured. However, convenience is not a reason to use broad administrator credentials or leave the tunnel running indefinitely. A native database endpoint deserves the same care as any other internet-reachable infrastructure.
When an HTTPS API is safer or more flexible
An API is preferable when the ETL job needs a narrow dataset rather than general database access. The application can enforce approved queries, omit confidential columns, aggregate records, validate filters, and present a stable contract even if the underlying schema changes. It can also implement API-specific authorization and auditing.
This approach introduces engineering work. A reliable extraction API needs pagination, deterministic ordering, error responses, timeout handling, and an incremental cursor or timestamp strategy where repeated full exports are impractical. It must define how deletions and updates are represented. The ETL tool must also support the API's authentication method and response format. If these requirements are not implemented carefully, an API may be narrower than a database tunnel but less reliable as a data source.
If the API runs locally, an HTTP/s tunnel can publish it through Localtonet. HTTP tunnel process types can use a random subdomain, a custom subdomain where supported, or a custom domain. Exact domain and DNS requirements should be checked against current Localtonet documentation before deployment.
When VPN Manager fits
Our VPN Manager provides a private mesh VPN with granular firewall rules and can bridge local LANs. It is conceptually appropriate when both ends can join the mesh or when a participating network can route the required resource. This is different from a standard TCP tunnel and should not be treated as the same feature under another name.
A fully managed ETL connector often gives the customer no operating-system access, so there may be nowhere to install or run the required private-network participant. In that case, private mesh access is not viable unless the ETL vendor supports a customer-managed worker, gateway, or agent. Review the Localtonet VPN Manager workflow alongside the deployment model of the selected ETL service before choosing this architecture.
Confirm the prerequisites before creating a tunnel
A few checks performed in advance prevent most failed deployments. Record the results as part of the pipeline design so operators know which system owns each control.
ETL connector requirements
- Supported source: Confirm that the ETL platform supports the exact database engine and version.
- Custom network destination: Verify that the connector accepts a custom public hostname and port. A connector that only supports vendor-managed instances or fixed cloud endpoints cannot use an arbitrary TCP tunnel.
- Authentication compatibility: Confirm support for the database authentication method you intend to use. Do not assume every connector supports client certificates, integrated identity, or every password mechanism.
- TLS controls: Determine whether the connector can require TLS, validate the server certificate, supply a trusted certificate authority, and verify the hostname where applicable.
- Extraction behavior: Identify whether the job performs full reads, incremental queries, log-based change capture, or another method. Each mode can require different database privileges and configuration.
- Network controls: If source IP allowlisting is part of the design, obtain the ETL service's documented egress addresses and confirm that the enforcement point can actually apply them.
- Connection behavior: Understand connection concurrency, query timeouts, retry policy, and scheduling. These affect database load and recovery after a temporary interruption.
Local environment requirements
- A running database that accepts TCP connections from the machine where the Localtonet client will run, or from another address reachable by that machine.
- A Localtonet-supported client installation on a device that can remain powered on for the required extraction window.
- Outbound network access from that device so the Localtonet client can establish and maintain its relay connection.
- A device-specific Localtonet authentication token handled as a secret. Never place the token in an article, shared ticket, pipeline log, or ETL hostname field.
- An available Localtonet relay server or region selected from the current dashboard. Availability can vary, so this guide does not hardcode a server code.
- A dedicated database account with only the schema, table, view, and operational privileges needed by the extraction method.
- A documented maintenance owner for the client, tunnel, database credentials, and ETL job.
A connectivity test should not be performed with a database superuser simply because it is convenient. Create a dedicated ETL identity, deny unnecessary write and administrative permissions, and expose only the required schemas or curated views. If the connector later needs an additional privilege for a documented feature, review and add that privilege deliberately.
Prepare the local database for controlled ETL access
Database configuration varies by engine, version, operating system, and connector. For that reason, this guide does not guess service names, configuration file paths, default ports, or vendor-specific commands. Use the database's official administration procedure for the controls below, then test from the same device that will run the Localtonet client.
Choose the Localtonet client location
Running the client on the database host can minimize the local network path. If the database accepts connections only on its loopback interface, a client on that same host may be able to target the loopback address. A client on another LAN machine cannot reach the database through the database host's loopback interface.
Running the client on a separate gateway or utility server can reduce software installed on the database host, but the database must then listen on an appropriate LAN interface and permit connections from that client device. The network between the client and database becomes another dependency. Choose one topology intentionally and avoid broad listening rules that make the database available to the entire LAN without need.
Create a dedicated extraction identity
Give the ETL process its own account rather than sharing an application or human administrator identity. For a basic snapshot extraction, read-only access to selected views or tables may be sufficient. Incremental replication and change data capture can require metadata, logging, replication, or other specialized permissions. Grant only requirements documented for the exact connector mode.
Curated database views are useful when the pipeline needs only a subset of fields. They can hide sensitive columns, normalize names, and provide a stable extraction surface. Row-level policies may provide additional separation where the database supports them and where the connector behaves correctly with those policies.
Plan transport security end to end
A TCP tunnel transports the database protocol but does not replace database authentication or automatically establish that the database connector is using its own TLS mode. Configure database-native TLS when supported, require it on the extraction identity where the database allows that policy, and configure the ETL connector to validate certificates rather than silently accepting any certificate.
Certificate hostname validation deserves special attention. The ETL connector connects to the public tunnel hostname, while the database certificate may have been issued for an internal database name. Whether a connector permits a separate TLS server name, custom trust material, or another supported configuration is product-specific. Do not disable certificate verification merely to make the first test pass. Resolve the name and trust design according to the database and ETL vendor documentation.
Test local reachability first
Before creating the public path, use an approved database client from the intended Localtonet device to connect to the exact local target address and port. Authenticate with the dedicated ETL identity and run a small read against an approved table or view. This proves that the database listener, local firewall, account, grants, and TLS settings work independently of the tunnel.
If this local test fails, adding a tunnel will not repair it. Troubleshoot the listener address, local routing, firewall policy, credentials, certificate trust, and database logs before continuing.
Create the Localtonet TCP tunnel

Use a TCP tunnel for a connector that communicates through the database's native TCP protocol. The workflow below follows the Localtonet lifecycle: install and run the client, identify the device, select an available relay, create the local target, start the tunnel, and then use the assigned endpoint.
Install and run the Localtonet client
Install our client on the database host or another device that can reach the database. Keep the client running for every period in which the ETL service must connect. Current installation choices should be taken from the Localtonet application and documentation rather than from unverified commands.
Authenticate and select the device
Use the device-specific authentication token associated with the client that will carry the tunnel. Treat this token as a secret. Confirm that the intended device appears connected before configuring the database target.
Select an available relay server
Choose a relay server or region from the values currently available in the dashboard. Do not copy a server code from an old tutorial because current availability can vary by deployment, plan, or product state.
Create a TCP target for the database
Select the TCP tunnel type and enter the local IP address and port that were proven during local verification. If the client runs on the database host, this may be a loopback target when the database is configured accordingly. If the client runs elsewhere, use the database address reachable from that client device.
Start the tunnel
Creating a tunnel does not make it active. Press Start and confirm that the selected client remains connected. The tunnel is available only while it is running and its selected device is online.
Configure the ETL connector with the assigned endpoint
Enter the public host and port assigned to the TCP tunnel in the ETL connector, along with the dedicated database name, account, credentials, and required TLS settings. Store database secrets in the ETL platform's supported secret facility rather than embedding them in job names, documentation, or scripts.
The Localtonet documentation provides the current product navigation for supported tunnel categories. Dashboard values should remain the authority for relay selection and the endpoint assigned to a particular tunnel.
Do not depend on the obscurity of the assigned endpoint. Require strong database authentication, use a dedicated identity, enable database-native TLS where supported, monitor failed logins, and stop the tunnel when remote extraction is not required. Never expose a database that has no authentication.
Verify the complete connection in layers

A successful dashboard status is necessary, but it does not prove that the ETL job can authenticate, validate TLS, discover schemas, or complete a query. Verify each layer separately so a failure can be assigned to the correct system.
Repeat the local database test
From the Localtonet client device, connect to the configured local target with the dedicated ETL account. Run a small, read-only query against an approved object and confirm the expected result.
Confirm the client and tunnel are running
Verify that the selected device is connected and that the TCP tunnel has been started. Remember that creating the tunnel configuration alone is not sufficient.
Test the public endpoint from an authorized external network
When policy permits, use a compatible database client outside the local network to test the assigned public host and port. Apply the same TLS validation and dedicated credentials intended for ETL. Avoid broad or anonymous port-scanning services because they do not validate the database protocol safely.
Run the ETL connector's connection test
Use the ETL platform's supported test function. A network timeout, TLS error, authentication rejection, and authorization failure are different problems, so preserve the exact sanitized error category for troubleshooting.
Perform a limited extraction
Start with one small table or curated view. Validate row counts, field types, timestamp handling, and destination results before widening the scope or enabling a frequent schedule.
Test interruption and recovery
During an approved maintenance window, stop the tunnel or client and confirm that the ETL job fails safely rather than producing a silently incomplete result. Restart the required components and verify that the connector retries or resumes according to its documented behavior.
Distinguish connectivity from data correctness
Network success says only that a session can reach the database. It does not prove that the extraction is complete. Validate expected row counts, update and deletion handling, timezone conversion, numeric precision, character encoding, and the incremental cursor. For change data capture, confirm that the connector progresses through changes without gaps and that required database logs are retained long enough for realistic outages.
Use a non-sensitive sentinel dataset for recurring checks when practical. A small table or view with known values can prove that the scheduled job reads from the intended database and writes to the intended destination without exposing confidential data in monitoring output.
Harden a database tunnel for ETL use
Direct database connectivity can be appropriate, but it creates a high-value access path. Security should be applied at the database, transport, connector, operating system, and lifecycle layers instead of relying on one control.
Use source IP restrictions only where they are enforceable
Some managed ETL providers publish stable egress addresses, while others use changing ranges or do not promise a fixed source. Source IP filtering is useful only if the provider documents the addresses and an actual enforcement point in the chosen architecture can apply them.
Do not assume which source address the local database will observe through a relayed tunnel. That behavior can depend on the tunnel implementation and protocol path. Test the observed database connection metadata in your environment. If source-based policy is mandatory, verify the full behavior before approving the architecture or place a controlled database proxy or API in front of the database where the required policy can be enforced.
Protect every credential independently
The Localtonet device token and database password serve different purposes. The device token identifies the client that runs the tunnel. The database credential authenticates the ETL session to the database. Neither should appear in the public endpoint, screenshots, source control, query text, or general logs.
Rotate credentials according to organizational policy and after suspected exposure. Test rotation with a limited extraction before revoking the old database secret if continuity is required. Remove obsolete accounts and device tokens when a host or integration is retired.
Control database workload
Least privilege does not prevent an authorized query from consuming excessive CPU, memory, I/O, or locks. Begin with a limited schedule and dataset. Use database-supported workload controls, statement timeouts, read replicas, or reporting views where appropriate. Exact controls differ by database and should be configured according to its official documentation.
Coordinate full refreshes with backup windows and application peaks. Incremental extraction can reduce repeated reads, but it may require more database privileges and operational preparation. Do not enable change data capture based only on a connector checkbox without reviewing the database-side consequences.
Operate the tunnel as part of the data pipeline
The tunnel is an infrastructure dependency, not a one-time setup task. Assign ownership and include it in monitoring, maintenance, incident response, and decommissioning.
Align the tunnel lifecycle with the ETL schedule
A Localtonet tunnel is available only while the selected client is connected and the tunnel is running. If extraction occurs continuously, the client host must be maintained as an always-available component. If extraction occurs in defined windows, operators can reduce unnecessary exposure by starting the tunnel before the job and stopping it afterward using an approved operational process.
Do not assume an endpoint, option, or relay choice will remain suitable forever. Record the assigned host and port in the integration inventory, but confirm current dashboard state before migrations or disaster-recovery tests. Plan and feature availability can vary, so validate required behavior against the current product rather than relying on old screenshots.
Monitor connection state
Localtonet platform-wide Token/Tunnel webhooks can report when a token or tunnel in a selected Token Group changes to Connected or Disconnected. The webhook sends a WebHookRequest JSON body containing Id, ActionDate, Type, and Status. The type identifies a token or tunnel, and the status is Connected or Disconnected.
These lifecycle webhooks should not be confused with File Server file-event webhooks. File Server webhooks concern upload, delete, rename, and move events and are unrelated to database query activity. A tunnel connection webhook also does not prove that the database is healthy, so combine it with ETL job monitoring and database-side checks.
Document a recovery sequence
- Confirm that the database service is healthy and that the local target still accepts the dedicated account.
- Confirm that the Localtonet client device is powered on, connected to its network, and authenticated.
- Confirm that the intended TCP tunnel is started.
- Verify the public host and port recorded in the ETL connector against the current tunnel assignment.
- Run the connector's connection test and classify the result as network, TLS, authentication, authorization, or query related.
- Run a limited extraction before resuming the normal schedule.
Decommission cleanly
When the pipeline is retired, disable its schedule, stop and delete the tunnel if it has no other approved purpose, revoke the dedicated database account, remove unnecessary database grants, and remove obsolete Localtonet device access. Preserve only the audit records required by organizational policy. Leaving an unused tunnel or credential available creates avoidable risk.
Troubleshoot common connection failures
Troubleshooting is fastest when each error is mapped to a layer. Avoid changing the database listener, firewall, tunnel, TLS settings, and credentials simultaneously because that makes the eventual fix difficult to identify and review.
| Symptom | Likely layer | Checks and corrective action |
|---|---|---|
| The ETL connector times out | Client, tunnel, endpoint, or local reachability | Confirm the Localtonet client is connected, the tunnel was explicitly started, the ETL host and port match the assigned endpoint, and the client device can still reach the configured local target. |
| The tunnel is running but the target refuses the connection | Database listener or local firewall | Repeat the connection test from the Localtonet device to the exact local IP and port. Confirm that the database listens on the intended interface and permits that device. |
| Authentication fails | Database identity | Check the username, secret, authentication mechanism, account state, and allowed login context. Use the dedicated account locally to separate credential failure from tunnel failure. |
| Connection succeeds but schema discovery fails | Database authorization or connector compatibility | Review required metadata privileges and supported database versions. Grant only the documented missing permission rather than switching to an administrator account. |
| TLS handshake or certificate validation fails | Database TLS and connector trust | Inspect the certificate chain, validity, trust configuration, protocol support, and hostname expectation. Do not solve the problem by permanently disabling certificate validation. |
| Small tests pass but full extraction fails | Workload, timeout, or connection limits | Check database resource consumption, query duration, locks, ETL timeout settings, and concurrent connection limits. Reduce the initial scope and review incremental extraction options. |
| Scheduled jobs fail after the workstation sleeps | Client host availability | Keep the selected device powered and connected during extraction windows, or move the client to an appropriate always-on system that can reach the database. |
| The connector does not offer a host and port field | ETL product design | The connector may not support arbitrary database endpoints. Investigate a vendor-provided local agent, a self-hosted worker, an HTTPS API connector, or another documented integration method. |
| Extraction reconnects but data is missing or duplicated | Incremental state or change capture | Review the connector cursor, checkpoint, retry semantics, deletion handling, and database log retention. Network restoration alone cannot guarantee correct replication state. |
Record timestamps, sanitized error categories, tunnel state, connector run identifiers, and database log events. Remove passwords, device tokens, connection strings containing secrets, private endpoints, and sensitive query results before sharing diagnostic material.
Frequently asked questions
Can a cloud ETL service connect to a database behind CGNAT?
Yes, if the ETL connector accepts a reachable endpoint and the chosen architecture supports its protocol. With a Localtonet TCP tunnel, our client establishes an outbound relay connection and supplies a public host and port for the local TCP target. This avoids relying on an inbound route through CGNAT. The database connector must still support the database, authentication method, and TLS configuration.
Does a Localtonet TCP tunnel replace database TLS?
No. A TCP tunnel provides network forwarding for the database protocol. Configure database-native TLS and certificate validation when they are supported by both the database and ETL connector. Authentication, authorization, and database protocol security remain necessary.
Must the Localtonet client run on the database server?
Not necessarily. It can run on the database host or on another device that can reach the database's local IP address and port. If it runs on another device, the database must listen on a reachable interface and local network policy must permit that connection. Test from the selected client device before creating the tunnel.
Is an HTTPS data API safer than exposing the database protocol?
It can provide a narrower interface because the API can expose only approved operations and fields. It is not automatically safe, however. The API still requires authentication, authorization, input validation, pagination, rate control, monitoring, and secure implementation. It also must support the ETL tool's required extraction and incremental synchronization behavior.
Can VPN Manager connect a managed ETL platform to the local LAN?
It depends on the ETL deployment model. VPN Manager provides a private mesh VPN with granular firewall rules and can bridge local LANs, but the ETL side needs a viable way to participate in or route through that private network. Many fully managed connectors do not allow customers to install networking software. A self-hosted worker or vendor-supported gateway may make the mesh design possible.
Can I restrict a database tunnel to the ETL provider's source IP addresses?
Use source IP restrictions only when the ETL provider publishes stable egress addresses and the selected enforcement point supports the required policy. Do not assume which source address the database will observe through a relayed connection. Validate that behavior in your environment and retain database credentials, least-privilege grants, and TLS as independent controls.
Why does the ETL job fail even though the tunnel shows as connected?
Tunnel connectivity does not prove database readiness. The local target may be unreachable, the database may reject the account, certificate validation may fail, permissions may be insufficient, or a query may exceed resource and timeout limits. Test local reachability, tunnel state, external protocol access, authentication, schema discovery, and a limited extraction as separate layers.
Should the tunnel remain running all the time?
Only if the approved pipeline requires continuous or unpredictable access. For scheduled extraction windows, stopping the tunnel after successful completion can reduce unnecessary exposure. In every case, the tunnel works only while it is started and its selected client device remains connected.
Create a controlled path for your ETL connector
Install the Localtonet client on a device that can reach your database, create a TCP tunnel for the verified local target, and give your compatible ETL connector the assigned public host and port. Begin with a dedicated read-only identity and a limited extraction before expanding the pipeline.
Get Started Free โ