Skip to content
AtGlance
Remote Tunnel

Add servers behind a bastion or without a public IP

How to add servers to the console when they have no public IP address, or when you reach them only through a bastion (jump host). For example: the internal VMs of an Azure VNet or AWS VPC, or a data centre behind a firewall.

The servers never need a public IP. They always connect out to the console:

  • The atglance CLI (login, system register, checks and sync) uses the console's API gateway on port 8002.
  • The agent (live monitoring, AtGlance 3.0) connects to /agent/v1/connect on the console's web port.

What matters is how a server can reach the console. The bastion is only how you log in to the server to run the commands.

Three ways to add servers without a public IP. A: the servers reach the console's address outbound, through NAT, on port 8002 and the agent endpoint. B: an Agent Tunnel connector in the private network dials the console's tunnel service on port 8443 and offers the console on local ports 8000 and 8002. C: you log in to the servers through the bastion, with SSH or a Remote Tunnel terminal, to run the commands.

Pick a way

Your situation Use
The servers have outbound Internet (NAT gateway) and the console has a public address, or the networks are linked (VPN, peering, ExpressRoute, Direct Connect) A. Direct to the console
The console is private (no public address), or the servers may not reach it directly B. Through an Agent Tunnel connector
The console reaches the servers (for example through the bastion), but they cannot reach it Reverse tunnel: the console keeps an SSH connection to each server; nothing to install or open

In both cases, use C to get a shell on the servers.

Step 1: Log in to the server (C)

Choose one:

  • Your own SSH, through the bastion:

    ssh -J <user>@<bastion-public-ip> <user>@<server-private-ip>
    
  • A Remote Tunnel terminal in the console, with no SSH client on your machine: a Direct profile with the bastion as an SSH hop, then Open a session › Terminal to the server's private IP. Setup: Bastion in Azure or AWS.

Then install the atglance CLI on the server: see the CLI reference.

Step 2A: Direct to the console

  1. The server must reach the console's address on port 8002. Test it from the server:

    curl -sS -o /dev/null -w '%{http_code}\n' http://<console-address>:8002/
    

    Any HTTP status (for example 404) means it is reachable; a timeout means it is not.

  2. Log in and register:

    sudo atglance login --server http://<console-address>:8002
    # API token (atgla-...): paste a key from the console (Settings › API keys)
    sudo atglance system register
    

    Use https:// when the console's address has a certificate.

  3. Optional: live monitoring. The agent connects to the console's agent address (wss://<console>/agent/v1/connect), so the server must reach it too:

    sudo atglance agent install
    

Cloud firewalls: allow outbound TCP 8002 (and 443 or 8000 for the agent) from the servers. Nothing inbound is needed on the servers.

Step 2B: Through an Agent Tunnel connector

The connector is a small service on one host in the private network, for example the bastion. It dials the console's tunnel service outbound (TCP 8443, mutual TLS), and offers the console inside the network on its own ports 8000 (web console and API) and 8002 (the CLI's API).

  1. Make the tunnel service reachable from that network: the console's tunnel port (8443) on a public address or a published gateway. On the console, in .env:

    TUNNEL_PUBLIC_NAMES=console.example.com
    ATGLANCE_TUNNEL_PUBLIC_URL=wss://console.example.com:8443
    

    Start the console with docker-compose.tunnel.yml and docker-compose.tunnel-connectors.yml. See Published gateway when the console itself stays private.

  2. Create the Site and an Agent Tunnel profile (Remote Tunnel › New Site, then New profile › Agent Tunnel) with the servers' subnet in the allow-list, for example 10.20.1.0/24 ports 22,443.

  3. Install the connector on the bastion (or another host in the network): profile › Add connector, then run the command the console shows. See Agent Tunnel setup.

  4. Switch on Console access on the Site page: Web console and API (port 8000) and Agent API (port 8002).

  5. Allow the servers to reach the connector host on TCP 8000 and 8002 inside the network:

    • Azure: an NSG rule from VirtualNetwork to the connector VM, ports 8000 and 8002;
    • AWS: on the connector instance's security group, allow 8000 and 8002 from internal-sg.
  6. Log in and register each server through the connector:

    sudo atglance login --server http://<connector-private-ip>:8002
    sudo atglance system register
    

The CLI's scheduled checks and sync keep using that address. The servers never learn the console's own address, and no inbound port opens on the servers or on the console's network.

Live monitoring agents connect to the console's agent address, which the console sets for all agents. Through a connector this path is not supported yet: use way A for servers that run the agent.

Step 3: Check

  • On the server: atglance whoami shows the console and your user; atglance system status shows the registration.
  • In the console: the server appears under Systems. With the agent, it appears under Servers.
  • With a connector: the Site page shows the Console access connection count and traffic.

Troubleshooting

Problem Check
atglance login times out The server cannot reach that address on 8002. A: the NAT gateway or route, and the outbound firewall. B: the connector host's firewall allows 8000 and 8002 from the servers, and Console access is on
401 or "invalid token" Create a new API key in the console (Settings › API keys) and log in again
The connector is Offline It cannot reach ATGLANCE_TUNNEL_PUBLIC_URL on 8443: run atglance-connector diagnose on the connector host
Registered, but the agent never connects The server cannot reach the console's agent address. Use way A for that server
You cannot log in to the server Step 1: the bastion's firewall allows port 22 from your address; for a Remote Tunnel terminal, the host key is confirmed and the server is in the profile's allow-list

See also: