For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/pl/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/pl/llms-full.txt, and this page is available as Markdown at https://docs.ovhcloud.com/pl/guides/public-cloud/network-services/site-to-site-vpn-getting-started.md.
Przejdź do treści

Site-to-Site VPN - Get started in the Console

Pokaż jako Markdown

Create a VPN gateway and an IPsec connection with one or two tunnels to a remote site from the Public Cloud section of the OVHcloud Console

Objective

This guide explains the objects Site-to-Site VPN uses and their limits, then walks you through the Console: create a VPN gateway, create an IPsec connection (endpoint groups, security proposal, one or two IPsec tunnels), and read the values to set on the remote device.

Warning

Site-to-Site VPN is in alpha, for testing and evaluation only: do not use it for production workloads. No SLA applies during the alpha. Each VPN gateway runs on a single instance: a failure of that instance interrupts its tunnels until it is back. The Console offers the regions of your project where Site-to-Site VPN is available (Gravelines (GRA7) during the alpha), and Site-to-Site VPN is free. Screens and behaviour may change before general availability.

In this guide, you will learn how to:

  • understand the objects Site-to-Site VPN creates and the limits that apply to them;
  • open Site-to-Site VPN in a Public Cloud project;
  • create a VPN gateway attached to your private networks and to the public network;
  • create an IPsec connection to a remote site with the creation page;
  • route your instances to the VPN gateway, so they reach the remote networks, and check that the tunnels are up.

Requirements

  • A Public Cloud project in your OVHcloud account.
  • Site-to-Site VPN available on the project. The alpha is open, with no sign-up, to the first 100 customers. Without it, the Site-to-Site VPN entry is not shown in the menu, and the Site-to-Site VPN pages redirect to the project's dashboard.
  • A private network with a subnet in a region where Site-to-Site VPN is available (Gravelines (GRA7) during the alpha). If you have none, you can create one while creating the VPN gateway.
  • A remote device (an on-premises router, a firewall or another cloud's VPN gateway) with a public IPv4 or IPv6 address, which you can configure.

Key concepts

Site-to-Site VPN connects the private networks of your Public Cloud project to a remote site through IPsec tunnels. The OVHcloud end of the tunnels is a VPN gateway: a router dedicated to IPsec, attached to your private subnets on one side and to the public network on the other, in one region fixed at creation. The remote end is your own device: a firewall or router on premises, or the VPN service of another cloud provider.

  • Endpoint group: a named list of CIDRs in one region — an IPsec connection's local (OVHcloud side) or remote (the remote site's) networks. Several connections can share one.
  • IKE policy and IPsec policy: the phase 1 and phase 2 algorithms (encryption, integrity, Diffie-Hellman group, lifetime) a tunnel negotiates. Configure the same algorithms on the remote device. Policies are shared objects: several tunnels can use the same pair.
  • IPsec connection: describes one remote site — the gateway it runs on, its routing mode (static or BGP) and its two endpoint groups. These are fixed once the connection exists; only its name and description can change. A VPN gateway holds several IPsec connections, one per remote site.
  • IPsec tunnel: carries the per-tunnel settings — the peer's public address, the pre-shared key, the IKE and IPsec policies, dead peer detection, MTU. A connection holds up to two tunnels; the lowest-priority one is preferred, giving a standby path.
  • Pre-shared key (PSK): tunnels authenticate with a PSK only — certificate authentication is not supported. Each tunnel either gets a random key of 48 characters, created with it, or takes your own: 16 to 255 printable ASCII characters. You can read the key on the tunnel later, if your account is allowed to, and replace it with Change the pre-shared key, by a new generated key or one of your own: the tunnel then stays down until the remote device uses the same key.
  • Routing: a connection is static (the remote endpoint group's networks are routed into the tunnels; failover between two tunnels is active/standby, non-preemptive) or BGP (one eBGP session per tunnel; failover follows BGP and is preemptive). In both modes, traffic to the remote networks is dropped, never sent unencrypted, when every tunnel is down.
  • Status: the Console shows whether each VPN gateway and IPsec tunnel works, as OVHcloud last observed it: Up, Down or Unknown (not observed recently), and Disabled for a disabled tunnel. An IPsec connection takes its status from its tunnels: Up when all of them are up, Degraded when some are up and others are not (the remote site is still reached, without redundancy), Down when none is up, Unknown when none has been observed recently, Disabled when all of them are disabled. A disabled tunnel does not count: one tunnel up and one disabled reads Up. A status shows once the object is ready and has been observed; until then, the Status columns show a dash.

Key limits

  • A VPN gateway holds several IPsec connections, each holding up to two IPsec tunnels.
  • The remote networks of two IPsec connections of the same VPN gateway must not overlap.
  • The BGP connections of a VPN gateway share one local ASN.
  • The policies accept a hardened set of options: IKEv2 only, AES (CBC or GCM) with SHA-2; weaker options (IKEv1, SHA-1, 3DES, Diffie-Hellman groups 2 and 5) are refused.
  • A remote network cannot be a default route (0.0.0.0/0 or ::/0), nor contain a tunnel's peer address.
  • A BGP connection carries one address family: its networks and tunnel addresses are all IPv4, or all IPv6.

OVHcloud Console Access

  • Direct link:
  • Navigation path: Public Cloud > Select your project > Network > Site-to-Site VPN

Instructions

This section covers the whole first setup, in the order the Console expects it.

Contents:

Step 1 - Open Site-to-Site VPN

In the project menu, the Site-to-Site VPN entry carries an Alpha tag. In a project with no VPN gateway, the page presents the product in place of the tabs, under Your networks, joined to your remote sites: the setup in three steps (VPN gateway, IPsec connection, Routes), the regions where Site-to-Site VPN is available and the number of tunnels per connection, with a Create a VPN gateway button. Once a gateway exists, the page has five tabs: VPN gateways, IPsec connections, Endpoint groups, IKE policies and IPsec policies.

Step 2 - Create a VPN gateway

The VPN gateway is the first object to create: an IPsec connection always runs on a VPN gateway.

  1. Click Create a VPN gateway.
  2. In Name, enter a name (at most 255 characters). A name already used by a VPN gateway of the project is refused. A default name of the form vpn-gw-<ddmmyyyy> is filled in.
  3. In Region, select the region of the gateway. One card is shown per region of your project where Site-to-Site VPN is available (Gravelines (GRA7) during the alpha). The region cannot be changed once the gateway exists, and its private networks are in this region.
  4. In Network configuration, choose a Private network and a Subnet for each subnet the gateway must serve. The first subnet of the region is pre-selected. Click Add a subnet to add a row, or the remove button of a row to drop it. The gateway takes a private IP in each subnet, and any host of these subnets can reach it.
    • To create a private network with the gateway, select + New private network in Private network, then enter the Private network name, the Subnet name and the Subnet address (CIDR): an IPv4 range from /9 to /29. In a region with no subnet, the first row starts on a new private network.
    • To add a subnet to an existing private network, select + New subnet in Subnet, then enter the Subnet name and the Subnet address (CIDR).
    • A new subnet is pre-filled with the first 10.x.0.0/24 range that overlaps no other subnet of the region. The Private network name and Subnet name are pre-filled with private-network-<ddmmyyyy> and subnet-<ddmmyyyy>. A range that overlaps another subnet of the private network or of the VPN gateway is refused.
    • Below the rows, the page states the public connectivity: there is nothing to choose. The VPN gateway receives a public IPv4 and a public IPv6 address, kept until it is deleted, and each IPsec tunnel uses the one of its peer's family.
  5. Check the summary on the right (Region, Private networks, Public IP), then click Create the VPN gateway.

The Console confirms that the gateway is being created: once it is ready, create its IPsec connection from its page. The new private networks and subnets are created first, then the gateway. If one of them cannot be created, an error toast Unable to create the VPN gateway names it, gives the API's reason and lists what was already created (it is kept). The gateway cannot carry an IPsec tunnel while it is being created, nor before it has a public IP.

Tip

A gateway created without any subnet carries no traffic until a subnet is attached. You can attach subnets later from the gateway's page, in its Private networks card.

Step 3 - Create the IPsec connection

The Create an IPsec connection page creates, in one submission, the endpoint groups you define as new, the IKE and IPsec policies if they are needed, the IPsec connection and its tunnels.

  1. Open the IPsec connections tab and click Create an IPsec connection. You can also open the gateway's page and click Create an IPsec connection in its IPsec connection card, which lists the gateway's connections: the gateway is then pre-selected.
  2. In IPsec connection, enter a Name. A default name of the form ipsec-connection-<ddmmyyyy> is filled in.
  3. In VPN gateway, select the gateway. A gateway that already holds IPsec connections can take another one, to another remote site. A gateway that cannot carry a tunnel yet is listed but cannot be selected, with its reason: Creating — no public IP yet, Updating — retry once it is ready, Being deleted, Not attached to the public network or No public IP yet.
  4. In Routing, select Static or BGP:
    • Static: the remote networks go over the tunnel with the lowest priority; the other takes over when it fails.
    • BGP: one eBGP session per tunnel; only routes within the remote endpoint group are accepted (up to 100). Enter the Local ASN and the Peer ASN, and turn on the Inbound ECMP switch if the remote device can balance its traffic over both tunnels. The two ASNs must differ, and each must be between 1 and 4294967295, other than 23456. The Local ASN is pre-filled with 65000, or, when the gateway already has a BGP connection, with that connection's local ASN: the BGP connections of a gateway share one local ASN, and another one is refused.
  5. In Endpoint groups, define the Local endpoint group (the OVHcloud side) and the Remote endpoint group (the remote site's networks). For each side, select Existing endpoint group and pick a group of the gateway's region, or New endpoint group and enter a Name and its CIDRs (Add a CIDR adds a row). Both sides start on a new endpoint group. A new local group is pre-filled with the CIDRs of the subnets the gateway is attached to. A remote network cannot be a default route (/0), no remote CIDR may contain a tunnel's peer address, and no remote network may overlap one that another IPsec connection of the gateway already reaches. On a BGP connection, use only IPv4 or only IPv6 CIDRs.
  6. In Security proposal, select the algorithms both tunnels negotiate:
    • The first option, marked Recommended: IKEv2 · AES-256 · SHA-256 · Group 14 (MODP-2048) with a lifetime of 10800 seconds for phase 1, and ESP · Tunnel · AES-256 · SHA-256 · Group 14 (MODP-2048) with a lifetime of 3600 seconds for phase 2. If the gateway's region already has an IKE and an IPsec policy with exactly these algorithms and lifetimes, the tunnels use them. Otherwise, ike-aes256-sha256 and ipsec-aes256-sha256 are created with the connection. The remote device does not need to match this lifetime: each side rekeys independently on its own timer.
    • Existing policies: pick an IKE policy and an IPsec policy of the gateway's region, for a remote device with its own algorithms. This option is disabled while the region has no IKE policy or no IPsec policy. To use other algorithms or a different lifetime, create the policies first from the IKE policies and IPsec policies tabs.
  7. In IPsec tunnels, select Two (recommended) or One, then fill in each IPsec tunnel block:
    • Name: pre-filled with the default connection name followed by -1 and -2 (for example ipsec-connection-10112026-1). These names do not follow a connection name you type: change them here if you want them to match.
    • Peer address: the public IPv4 or IPv6 address of the remote device for this tunnel.
    • Priority: pre-filled with 1 and 2. The lowest is preferred.
    • Pre-shared key: keep Generate a key, the default, to have a random key of 48 characters created with the tunnel, which you then read on the tunnel as described in Step 4. Or select Use my own key and enter your key: 16 to 255 printable ASCII characters.
    • On a BGP connection, BGP tunnel address and BGP peer address: when you select BGP, empty fields are pre-filled with free /30 networks of 169.254.0.0/16 (169.254.10.1/30 and 169.254.10.2, then 169.254.10.5/30 and 169.254.10.6, when nothing else uses them). The remote device must use the same addresses.
  8. Check the summary on the right, then click Create the IPsec connection. The button stays disabled until every step is valid.

Peer ID, Local ID, dead peer detection, MTU and initiator take their defaults. You can change them later from each tunnel's page.

If the submission fails part-way, an error toast Unable to create the IPsec connection names the step that failed, the API's reason and what was already created and kept. The page stays open with what you entered, so you can fix it and submit again.

Step 4 - Configure the remote device

Once the connection is submitted, the page turns into a recap, headed by the reminder Set the same pre-shared key on your remote device. It shows a Route the remote networks card (see Step 5), then one card per tunnel: Remote peer (our public IP), Their networks, Our networks, IKE (phase 1), IPsec (phase 2) and, on a BGP connection, BGP. The recap does not show the pre-shared keys.

  1. Configure these values on the remote device, with each tunnel's pre-shared key: the one you typed, or the generated one, read on the tunnel as described below.
  2. Add the host routes, as described in Step 5, before you leave the recap.
  3. Click Finish.

To read the same values later, open the connection's page and click Copy the remote device configuration on a tunnel. To read a tunnel's pre-shared key, click Show next to its Pre-shared key, on the tunnel's tile or in that configuration. The key can be read once the tunnel is created, and only if your account is allowed to read it: otherwise, the Console shows Your account isn't allowed to read this key. For the settings each provider expects, see the guides listed in Go further.

Step 5 - Route your instances to the VPN gateway

Your instances reach the remote networks through the VPN gateway once their subnet routes them there: each subnet of the gateway needs a host route per remote network, whose next hop is the gateway's private IP on that subnet. The subnet's DHCP hands these routes to every instance of the subnet.

  1. On the recap of the new connection, read the Route the remote networks card. It lists, for each subnet of the gateway, the route its instances need: <subnet> (<cidr>) · <remote network> → <gateway's private IP on that subnet>, one per remote network of the connection's address family. A subnet whose private IP is not known yet is left out.
  2. Click Add the routes. The routes are added after each subnet's existing host routes. A destination a subnet already routes, through this gateway or elsewhere, is left as it is, never overwritten. A toast confirms how many routes were added, and the button then reads Routes added.
  3. Apply the routes on the instances, as described below.

You can also add or change a subnet's routes later: open the gateway's page and, in the Private networks card, click Host routes on the subnet's row (the link shows once the gateway's private IP on the subnet is known). The subnet's page opens with its Add a route drawer, the gateway's private IP filled in as Next hop: enter the remote network as Destination, then click Add a route. A subnet's routes are listed, added and deleted on its page.

Warning

Instances pick up new host routes at their next DHCP lease renewal, which can take hours, or when they restart. Until then, they do not send traffic to the remote networks through the VPN gateway.

To apply the routes at once, restart the instances, or renew their DHCP lease from inside each instance. On a Linux image that uses systemd-networkd, such as Debian or Ubuntu, run sudo networkctl renew <interface>. The route then shows in ip route, for example 10.42.0.0/16 via 10.1.0.221 dev ens3 proto dhcp.

Step 6 - Verify

Check the objects and their status in the Console.

CheckWhereExpected
The gateway has its public addressGateway page, Public network cardPublic IPv4 (and Public IPv6) show an address
The gateway worksVPN gateways tab, Status column, or the badge next to the gateway's name on its pageUp
The gateway is on its subnetsGateway page, Private networks cardOne row per subnet, with its Private IP
The connection exists and reaches the remote siteIPsec connections tabOne row, with its VPN gateway, Routing, IPsec tunnels count and Status Up
The tunnels are upConnection page, IPsec tunnels sectionOne tile per tunnel, sorted by priority, each with the Up badge
The subnet routes the remote networksSubnet page, Host routes cardOne row per remote network, with the gateway's private IP as Next hop
An instance has the routeOn the instance, ip routeOne line per remote network, via the gateway's private IP

While a gateway or an enabled tunnel shows Down or Unknown, the Site-to-Site VPN pages refresh its status every 30 seconds, for at most 10 minutes, as long as the browser tab is visible. A tunnel shows Down until the remote device is configured with the same values and the pre-shared key: check the remote device's configuration, then its own tunnel status. A connection that shows Degraded still reaches the remote site through its other tunnel, without redundancy. A tunnel that is Up carries no traffic from your instances until their subnet routes the remote networks to the gateway (Step 5): to check the whole path, send traffic between an instance and a host of the remote network, for example with ping.

Go further

Join our community of users.

Czy ta strona była pomocna?