CloudAddress -- Quick Start v1.0.0

From nothing to a machine wearing a public IP from your cloud account -- verified, then torn down.

Applies to Cloud Spectra 1.0.0. Allow about 15 minutes, most of it the relay's first boot.

What you will build

By the end of this page one machine -- the one you type the commands on -- will be wearing a public address from your own cloud account, you will have checked that from the outside, and you will have removed it again. One command does the provisioning and the connection: cloudspectra_relay_client setup creates a relay in your cloud account, waits for it to boot, mints an enrolment token from the relay's dashboard, and connects this machine.

The examples use Oracle Cloud (--provider oci), which is the client's default cloud. Azure, Google Cloud and DigitalOcean work the same way: change --provider and supply that cloud's credentials in step 3. AWS is not a supported CloudAddress target in 1.0.0.

flowchart LR
    A["1. Licence key
~/.cloudspectra/credentials"] --> B["2. Install the client"] B --> C["3. Cloud credentials"] C --> D["4. setup
relay created + address worn"] D --> E["5. Verify"] E --> F["6. teardown"] style D fill:#d1fae5,stroke:#10b981,color:#065f46

Prerequisites

  • A Cloud Spectra subscription, or the intention to start one in step 1. The first 30 days are free.
  • An account on Oracle Cloud (or Azure, Google Cloud or DigitalOcean) with permission to create instances, networks, firewalls and public IP addresses.
  • A machine running Linux (kernel 5.10 or newer, x86_64 or arm64), macOS 13 or newer, or Windows (x64 or ARM64), on which you have administrator rights.
  • Outbound access from that machine to UDP port 28302 and TCP port 28300 on the internet -- the relay's tunnel and enrolment ports.
Do not run step 4 with --full-tunnel over an SSH session you depend on. A full tunnel moves the machine's default route to the relay, so every existing connection -- including the SSH session you typed the command into -- starts leaving through the relay. Run it at the machine itself, or leave out --full-tunnel and use the split-tunnel checks in step 5.

1. Save your licence key

1Subscribe and copy the key. Sign in at your Cloud Spectra account (we email you a sign-in code), choose the Developer or Enterprise plan and complete checkout. The licence key -- it begins CSTW1- -- is shown once when checkout completes. If you lose it, replace it from the same account page.

Save it where every Cloud Spectra tool looks for it by default. On macOS and Linux:

mkdir -p ~/.cloudspectra
umask 077 && printf '%s\n' 'CSTW1-...' > ~/.cloudspectra/credentials

On Windows, save the key in the file %USERPROFILE%\.cloudspectra\credentials.

To keep the file elsewhere, set CLOUDSPECTRA_LICENSE_KEY_FILE to its path. The tools read the key from a file, never from an environment variable's value: CLOUDSPECTRA_LICENSE_KEY is not honoured, because a key in the environment leaks into process listings and CI logs.

Treat the key like an API token. Anyone holding it can start relays on your subscription and take over an address you are using.

2. Install the client

2Download and install cloudspectra_relay_client for your platform. The client is free and is published at https://downloads.cloudspectra.ai/gateway/1.0.0/clients/.

Debian or Ubuntu (use arm64 in the file name on ARM):

curl -fsSLO https://downloads.cloudspectra.ai/gateway/1.0.0/clients/cloudspectra-relay-client_1.0.0_linux_amd64.deb
sudo apt install ./cloudspectra-relay-client_1.0.0_linux_amd64.deb

apt also installs what the package depends on (wireguard-tools, nftables and a few others) and starts the client's background service.

macOS (use amd64 in the file name on an Intel Mac):

curl -fsSLO https://downloads.cloudspectra.ai/gateway/1.0.0/clients/cloudspectra-relay-client_1.0.0_macos_arm64.pkg
sudo installer -pkg cloudspectra-relay-client_1.0.0_macos_arm64.pkg -target /

This installs CloudSpectra.app, the background daemon, and the command-line client at /usr/local/bin/cloudspectra_relay_client.

Windows -- in PowerShell run as Administrator (use arm64 in the file name on ARM):

curl.exe -fsSLO https://downloads.cloudspectra.ai/gateway/1.0.0/clients/cloudspectra-relay-client_1.0.0_windows_amd64.msi
msiexec /i cloudspectra-relay-client_1.0.0_windows_amd64.msi

The installer puts the client in C:\Program Files\CloudSpectra\ and registers the CloudSpectra Relay service. It does not add that folder to PATH, so the Windows commands below use the full path.

Other Linux distributions use the standalone binary, plus wireguard-tools and nftables from your distribution:

curl -fsSL https://downloads.cloudspectra.ai/gateway/1.0.0/clients/cloudspectra_relay_client-linux-amd64.gz | gunzip > cloudspectra_relay_client
sudo install -m 0755 cloudspectra_relay_client /usr/local/sbin/cloudspectra_relay_client

Check the installation:

cloudspectra_relay_client version

3. Give the client your cloud credentials

3Let the client reach your cloud's API. The relay is created in your account with your credentials, which stay on your machine. The client reads each cloud's standard credential sources:

Cloud--providerWhat the client reads
Oracle CloudociThe OCI CLI's configuration file, ~/.oci/config (or the OCI_CLI_USER, OCI_CLI_TENANCY, OCI_CLI_FINGERPRINT, OCI_CLI_KEY_FILE and OCI_CLI_REGION variables). Your tenancy must be subscribed to the region you use.
Microsoft AzureazureA service principal in AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET and AZURE_SUBSCRIPTION_ID, or a service-principal JSON file named by AZURE_AUTH_LOCATION.
Google CloudgcpA service-account key file named by GOOGLE_APPLICATION_CREDENTIALS (the project comes from the key, or from CLOUDSDK_CORE_PROJECT).
DigitalOceandoAn API token in DIGITALOCEAN_TOKEN (or DIGITALOCEAN_ACCESS_TOKEN), or a token file named by DIGITALOCEAN_CREDENTIALS_FILE.

Optional: instead of using your own administrative credentials day to day, let the client create a dedicated least-privilege identity in your account and use that from then on:

cloudspectra_relay_client login --provider oci

login shows the exact permissions it will grant and asks before creating anything; logout deletes the identity again. See Cloud credentials for the per-cloud options.

4. Create the relay and wear its address

4Run setup. On macOS and Linux, use sudo -E: raising the tunnel needs root, and -E keeps your environment -- your cloud credentials and your home directory, where the licence file is -- visible to the command.

sudo -E cloudspectra_relay_client setup --provider oci --name laptop --full-tunnel --daemonize

On Windows, in PowerShell run as Administrator:

& "C:\Program Files\CloudSpectra\cloudspectra_relay_client.exe" setup --provider oci --name laptop --full-tunnel --daemonize
FlagMeaning
--provider ociThe cloud to create the relay in: oci, azure, gcp or do. Add --region <region> to choose a region; otherwise your cloud configuration's region is used.
--name laptopThe relay's name. Relays are identified by project and name; the project defaults to default. Running the same command again adopts the existing relay instead of creating a second one.
--full-tunnelSend all of this machine's traffic through the relay, so its egress address becomes the relay's public IPv4. Leave it out for the default split tunnel.
--daemonizeHold the tunnel in a background process and give you your shell back once the address is worn.

A relay started from a stock image installs the relay software and its kernel on first boot and reboots, which takes a few minutes. On Oracle Cloud the first relay in a region and release imports the relay image into your tenancy instead -- several minutes, once -- and later relays start from that image. setup waits up to 30 minutes (--timeout). When the address is worn it prints:

relay ready -- this machine now wears <worn-address> (relay <public-ip>).
dashboard: https://<public-ip>:28300

  detached (pid <pid>). Logs: <log-file>
  stop the tunnel:  cloudspectra_relay_client disconnect --project default --name laptop
  destroy the relay: cloudspectra_relay_client teardown --project default --name laptop

<public-ip> is your CloudAddress. On Oracle Cloud, Azure and Google Cloud, <worn-address> is the relay's private address in its cloud network -- the cloud maps the public IP to it; on DigitalOcean the two are the same address.

Want to see inbound traffic arrive? Add --demo-web-server to the setup command. It serves a small HTTPS page from this machine on port 443 of the worn address and opens port 443 in the relay's cloud firewall. Open https://<public-ip>/ from another network -- a phone on mobile data is ideal -- accept the self-signed certificate warning, and the page shows this machine's CPU, memory and kernel. Leave it off otherwise: it is a public listener for demonstration only.
If you will use the relay's dashboard -- to add a phone or a second device, for example -- give setup a dashboard password with --admin-password '...' (at least 8 characters, with an upper-case letter, a lower-case letter, a digit and a special character). setup generates one otherwise and uses it only to mint its own token. Command-line values are visible to other local users in the process list, so prefer create followed by connect on a shared machine -- create generates a password and prints it once. See Creating a relay.
Without --daemonize, setup holds the tunnel in the foreground, and pressing Ctrl-C there brings the tunnel down and destroys the relay. Add --skip-teardown-on-abort if you want Ctrl-C to leave the relay running.

5. Verify

5Check what this machine is wearing. status reads this machine's local state only -- no cloud, no network. The state was written by the administrator account, so read it the same way (an elevated prompt on Windows):

sudo cloudspectra_relay_client status --name laptop

It shows the worn address, the relay, the tunnel interface and MTU, and tunnel UP with the holding process's pid.

Check your egress address (full tunnel). Ask any "what is my IP" service; the answer is the relay's public IPv4:

curl -4 https://ifconfig.me

With the default split tunnel this still shows your own connection's address -- only the relay's network goes through the tunnel -- which is expected.

Check that you are inside the relay's network (split or full tunnel). On a machine that is not itself a cloud instance, the cloud metadata address is routed to the relay, so this returns the relay's instance document. On Oracle Cloud:

curl -s -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/
CloudMetadata check
Azurecurl -s -H "Metadata: true" "http://169.254.169.254/metadata/instance?api-version=2021-02-01"
Google Cloudcurl -s -H "Metadata-Flavor: Google" "http://169.254.169.254/computeMetadata/v1/instance/?recursive=true"
DigitalOceancurl -s http://169.254.169.254/metadata/v1.json

On a machine that is itself a cloud instance, the metadata address deliberately stays local, so the same command reads that machine's own metadata.

Check inbound (optional). If you added --demo-web-server, open https://<public-ip>/ from another network as described above.

6. Tear down

6Give the address back and destroy the relay. Use the same --provider (and --region, if you passed one) as for setup:

sudo -E cloudspectra_relay_client teardown --provider oci --name laptop

On Windows: & "C:\Program Files\CloudSpectra\cloudspectra_relay_client.exe" teardown --provider oci --name laptop

teardown brings the tunnel down, removes this machine from the relay, and destroys the relay, which stops its Cloud Spectra meter. By design it keeps two things, so that a later setup comes back on the same address:

  • the public address, kept for the relay's address slot (--instance-index, 0 by default). Oracle Cloud does not charge for a kept reserved IP; Azure and Google Cloud do. DigitalOcean has no reserved address to keep.
  • the network -- network, subnet, gateway and firewall -- which costs nothing to keep.

To remove everything and keep nothing, add --delete-all. A released public address cannot be recovered; the next relay gets a different one.

sudo -E cloudspectra_relay_client teardown --provider oci --name laptop --delete-all

Confirm what remains with cloudspectra_relay_client list --provider oci: a relay that has been destroyed but whose address or network was kept is listed with what was kept.

Next steps