Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to Create a site-to-site VPN Tunnel

A site-to-site VPN connects two private networks over the Internet as if they were on the same local network, with end-to-end encrypted traffic.

In this tutorial you create the full tunnel between two VPC hosted in Plenit, configuring the two ends.

πŸ‘ What you get

An operational IPsec tunnel between two VPCs, with one end as a passive connection and the other as an active one, securely communicating their subnets.

How the tunnel works

The tunnel has two ends. One is configured as passive connection (waits for the other to start negotiation) and the other as active connection (starts it). Both share an IPsec key that authenticates them. The golden rule is symmetry: what is "remote" at one end is "local" at the other.

Field
End 1 (ext1)
End 2 (ext2)

VPC and local network

VPC1 / TIER1

VPC2 / TIER2

Remote gateway

VPC2 IP

VPC1 IP

Remote network

TIER2 subnet

TIER1 subnet

Role

Passive connection

Active connection

IPsec key

Generated when created

The saved key is entered

❗️ Save the IPsec key from the first end

When creating the first end, the platform generates the IPsec key. Copy it and save it: you'll need it exactly as is when configuring the second end, and it's what authenticates the tunnel.

Scenarios

Scenario
What you configure in Plenit

VPC1 and VPC2, both in Plenit

Both ends (double process)

VPC1 in Plenit, VPC2 with another cloud provider

Only ext1; the other side, with the provider's tool

VPC1 in Plenit, a router at the other end

Only ext1; the other side, on the router

This tutorial covers the first scenario, with both VPCs in Plenit.

Before you begin

  • Have a subscription of Servers active.

  • Having both VPC with their TIERs. If you're missing one, create them first: How to create a VPC and associate a TIER.

  • Locate the gateways and subnets in Networks/IP β†’ VPC Networks: you'll need them during configuration.


First end (ext1 β†’ ext2)

Step 1. Access the Servers subscription

Enter the subscription of Servers from its card.

{/* πŸ“Έ SCREENSHOT 1 Β· Servers subscription card */}

Access to the Servers subscription

Step 2. Start creating the tunnel

In the sidebar, open VPN and click Create Site-to-Site Tunnel.

{/* πŸ“Έ SCREENSHOT 2 Β· VPN subsection with the Create Site-to-Site Tunnel button */}

VPN subsection with the option to create a site-to-site tunnel

Step 3. Name the VPN and configure the remote network

  1. Assign a name to this connection, for example VPN1.

  2. In Gateway, enter the IP of ext2's remote gateway (the VPC2 IP).

  3. In Remote Network, specify the subnet of the TIER2.

{/* πŸ“Έ SCREENSHOT 3 Β· Name, Gateway, and Remote Network fields */}

First end name and remote network configuration

Step 4. Configure the tunnel

The default values work for this scenario; keep them unless your network policy requires others.

πŸ“˜ About tunnel parameters

Negotiation supports IKEv1, IKEv2, or automatic mode.

If you connect to several remote networks, an association is created for each network (split tunneling).

A single gateway supports up to ten VPN tunnels.

Step 5. Configure the local network and create the end

  1. Choose the VPC associated with the local network (VPC1) and the local network (TIER1).

  2. Mark this end as passive connection.

  3. Create this first part of the VPN.

When created, the platform shows the IPsec key. Save it: you'll use it in the second end.

{/* πŸ“Έ SCREENSHOT 4 Β· local network with passive connection checked and the generated IPsec key */}

Local network configuration as passive connection and the IPsec key

Second end (ext2 β†’ ext1)

Step 6. Create a new VPN

In the subsection VPN, click New Site-to-Site VPN to configure the reverse path.

Step 7. Name the second VPN and configure the remote network

  1. Name this connection, for example VPN2.

  2. In Gateway, enter the IP of ext1's remote gateway (the VPC1 IP).

  3. In Remote Network, specify the subnet of the TIER1.

{/* πŸ“Έ SCREENSHOT 5 Β· fields on the second end, reversed relative to the first */}

Second end name and remote network configuration

Step 8. Configure the tunnel of the second end

Keep the default values, as in Step 4. The difference is that here you enter the IPsec key that you saved when creating the first end.

Step 9. Configure the local network and create the VPN

  1. Choose the VPC associated with the local network (VPC2) and the local network (TIER2).

  2. Leave unchecked the passive connection, so that this end remains as active connection.

  3. Click Create VPN.

With this, the tunnel between the two ends is created.

{/* πŸ“Έ SCREENSHOT 6 Β· local network of the second end as active connection and the tunnel created */}

Configuration of the second end as active connection

Verify the tunnel

In the panel, in the subsection VPN, confirm that the two connections exist, one from ext1 and another from ext2, and that one appears as passive and the other as active.

The real test is that traffic crosses. From a TIER1 server, do a ping to a TIER2 server (and vice versa). Remember that in Windows you need to allow incoming ICMP on the destination.

Check that the route to the remote subnet goes out through the tunnel. On Linux:

On Windows, from PowerShell:

If something doesn't fit

Symptom
Likely cause
What to do

The tunnel does not come up

The IPsec key does not match at both ends

Re-enter on ext2 the key generated in ext1

The two ends do not negotiate

Both ended up passive or both active

Leave one passive and the other active

No traffic passes even though the tunnel is up

Remote and local network reversed on one end

Check the symmetry table: what is remote on one side is local on the other

The ping fails only against Windows

The firewall blocks incoming ICMP

Allow ICMPv4 on the destination server

Conclusion

With both ends correctly configured, you have an operational site-to-site VPN that securely connects the two VPCs over the Internet.

The whole procedure rests on two ideas: symmetry (what is remote on one side is local on the other) and the shared IPsec key.

If both match, the tunnel comes up; if something doesn't flow, it's almost always one of those two.

Last updated

Was this helpful?