| Cloud Documentation
1. Choose scenario
2. Your details
3. Provision
4. Configure tunnel
TL;DR - just give me the scripts, I can handle it myself

The complete provisioning script with placeholder variables in the header - fill in DC_ID, LOCATION, LAN IDs and run. It reserves an IP, creates the boot volume (separate step - server create --image-alias silently creates no disk), creates and boots the VM, attaches both NICs, opens the firewall (WireGuard variant; for IPsec open UDP 500 + 4500 instead of 51820) and reboots. Requires ionosctl, jq, and export IONOS_TOKEN=....

vpn-gw-setup.sh (generic, edit the header)

    
scroll to see full script
Tunnel configs: site-to-site · VDC-to-VDC · client-to-site

Before you start

No VDC route tables. Every VM that needs to reach the remote network must have a static route pointing to the gateway VM's private IP. Without this, traffic goes to the IONOS default gateway and gets dropped.
The firewall sits on the NIC, not on the VM. The DCD / Cloud API firewall is per-NIC and defaults to deny-all when active. You must open the tunnel port explicitly. The provisioning script below handles this.

Prerequisites

Setting up a user, group, and token (recommended)

The provisioning script needs a token with specific privileges. Best practice: create a dedicated non-admin user and group rather than using your contract admin account. This limits the blast radius if the token is compromised.

Required group privileges:
--reserve-ip - reserve public IP blocks
--create-nic - create internet access (public LANs/NICs)

Required resource shares:
The VDC(s) you want to provision into must be shared with the group as editable resources.
Via DCD (web UI):
  1. Go to Management > Users & Groups
  2. Create a Group (e.g. "vpn-provisioning"), enable the privileges: Reserve IP, Create Internet Access, and optionally Create Snapshot
  3. Under the group's Resources tab, add your VDC(s) with Edit rights
  4. Create a User (non-admin), add them to the group
  5. Log in as that user, go to Token Manager, generate a token
Via ionosctl (CLI):
user-group-setup.sh
# Run these as your contract admin user.
# 1. Create a group with the needed privileges
GRP=$(ionosctl compute group create \
  --name "vpn-provisioning" \
  --reserve-ip \
  --create-nic \
  -o json -w | jq -r '.id')
echo "Group: $GRP"

# 2. Share your VDC(s) with the group (edit rights)
ionosctl compute share create \
  --group-id "$GRP" \
  --resource-id "<YOUR-VDC-UUID>" \
  --edit-privilege -w

# 3. Create a non-admin user
USR=$(ionosctl compute user create \
  --first-name "VPN" --last-name "Provisioning" \
  --email "vpn-setup@example.com" \
  --password "$(openssl rand -base64 16)" \
  -o json -w | jq -r '.id')
echo "User: $USR"

# 4. Add the user to the group
ionosctl compute group user add \
  --group-id "$GRP" --user-id "$USR"

# 5. Log in as the new user and generate a token
ionosctl login --user "vpn-setup@example.com" --password "..."
ionosctl authentication token generate -o json | jq -r '.token'
# Use this token as IONOS_TOKEN in the provisioning script.
Admin tokens vs. scoped tokens. An admin user's token has full contract access. A non-admin user's token is limited to what their groups allow. For the provisioning script, a scoped token from a non-admin user is sufficient and safer.

1 Choose your scenario

🏢↔☁
A - Site-to-site
Connect your on-premises network to your VDC. One gateway VM in the VDC, the other end is your office router or firewall.
☁↔☁
B - VDC-to-VDC
Connect two IONOS VDCs across locations. One gateway VM in each VDC, WireGuard point-to-point between them.
💻→☁
C - Client-to-site
Remote users (admins, home office) connect to the VDC. Each user gets a WireGuard config file for their device.