Skip to content

Scenario: Multiple internal VMs behind one public IP

This scenario is for deploying multiple VMs. All instances are connected to an internal network and one public instance. The public instance is also connected to the public network with a public IPv4 address. It acts as a gateway or "jump server" to the internal instances.

gateway scenario

Deploy the instances

In this scenario, the internal template is used. You need to have Show all selected in the group selection to see it.

Make sure you have uploaded your SSH public key as described in Getting started.

First install the public instance, using the public template as described in scenario One VM with a public IP. Then install the internal instances:

  1. Navigate to Instances ➡ VMs in the menu and click on the button to create the VM.
  2. Select the template Ubuntu 22.04 (ice-internal).
  3. Fill in a VM name to use as hostname.
    • When creating several VMs, the wildcard %idx will be replaced with a number starting from 0. In the legacy Sunstone GUI, the wildcard is %i instead.
    • The VM Name defaults to the template name followed by the ID if left empty.
  4. Optionally, adjust the capacity in terms of Memory and Virtual CPU.
  5. Optionally, increase the Number of instances to as many as you want to deploy.
  6. Click Next and fill in a Password for console access.
  7. Click Next and configure any advanced options, adjusting storage, etc.
  8. Click Finish to deploy.

Access via SSH

The public instance can be accessed directly as described in the single instance scenario, see Access via SSH.

To access the internal instances the public instance can be used as a jump server for SSH using the -J command line argument:

ssh -J root@[Public instance public IP] root@[Internal instance IP]

SSH config

If you want to avoid typing the -J command line argument, you can update your client’s SSH configuration in ~/.ssh/config with the following:

Host [Internal instance name]
    HostName [Internal instance IP]
    ProxyJump root@[Public instance public IP]
    Name root

For example, having an internal instance that we call internal1 with IP 172.22.0.123 and the public IP of the public instance is 194.28.122.111:

Host internal1
    HostName 172.22.0.123
    ProxyJump root@194.28.122.111
    User root

Then we can access the internal instance with ssh internal1.