---
title: VPNs
slug: vpns
createdAt: 2026-02-07T06:49:10.643Z
---

# Overview

VPN provides a secure communications tunnel over a public network for remote user access and site-to-site connections (e.g. branch offices that need to collaborate and share resources).

***

# IPsec

KorGrid supports IPsec compatibility to allow for configuration of a VPN tunnel between your tenant and a third-party IPsec peer. (Typically, an enterprise firewall)

IPsec tunneling is an advanced configuration. It's recommended to use [Wireguard](https://docs.korgrid.com/vpns#wireguard) when possible as it provides better performance and a simpler configuration.

::::Tabs
:::Tab{title="High Level Steps"}
1. [Create a VPN Network](https://docs.korgrid.com/vpns#create-a-vpn-network)&#x20;
2. [Assign Public IP](https://docs.korgrid.com/vpns#assign-public-ip)&#x20;
3. Create a [Phase 1 Configuration](https://docs.korgrid.com/vpns#NXSCP)&#x20;
4. Create a [Phase 2 Configuration](https://docs.korgrid.com/vpns#phase-2-configuration)&#x20;
5. Configure [Firewall & Routing Rules](https://docs.korgrid.com/vpns#firewall-routing-rules)
6. [Connect to Peer](https://docs.korgrid.com/vpns#connect-to-peer)&#x20;
:::
::::



## Create a VPN Network

1. From the **Top Menu**, click **Networks** -> **+ New VPN**
2. Enter a **Name** for the network
3. (Optional), enter a **Description**
4. **Layer 2 Type**, select **None**
5. Select **Interface Network**
   - **-- None --** <font color="#2166AE">**(recommended)** </font>- to create a separate VPN network, where connections to other tenant networks is handled via Layer 3 routing.
   - **\[Existing Network]** - select an existing network to attach the VPN network directly to via Layer 2. (e.g., `vlan50`)
6. **IP Address Type**, select **Static**
7. Enter an **IP Address** for the network (e.g., `10.254.254.1`)
8. Enter a **Network Address** (e.g., `10.254.254.0/24`)
9. (Optional), enter a **Hostname** for the layer 3 routed interface
10. Click **Submit**

After creating the network, you must power it on for it to become active.

1. From the **left menu**, click **Power On**

****

## Assign Public IP

A public IP address must be reserved and assigned to allow external access to your tenant. There are two ways KorGrid can assign public IPs:

1. Single IP Assignment (/32)
   - A network block that contains a single IP address
   - Use the **Network Block Method**
2. Multiple IP Assignment (/29, /28, etc.)
   - A network block that contains multiple IP addresses
   - Use the **VIP Method**

ℹ️ Please reach out to KorGrid Support to request public IPs for your tenant.

::::::Tabs
:::::Tab{title="VIP Method"}
::::WorkflowBlock
:::WorkflowBlockItem
**Determine IP Address**

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the **External** network
3. From the **left menu**, click **View**
4. From the **left menu**, click **Network Blocks**
5. Determine the public IP address you wish to use from the network block
:::

:::WorkflowBlockItem
**Create VIP**

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the **External** network
3. From the **left menu**, click **View**
4. From the **left menu**, click **IP Addresses**
5. From the **left menu**, click **New**
6. **Type**, select **Virtual IP**
7. Enter the public IP address from the network block
   (e.g., `24.221.112.159`)
8. **Owner Type**, select **Network**
9. **Owner**, select the newly created VPN network
10. Click **Submit**
:::

:::WorkflowBlockItem
**Apply Rules**

After assigning an IP address to the VPN network you must apply the rules for the settings to take effect.

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **Apply Rules**
:::
::::
:::::

:::Tab{title="Network Block Method"}
1. From the **Top Menu**, click **Networks** -> **List**
2. Select the **External** network
3. From the **left menu**, click **View**
4. From the **left menu**, click **Network Blocks**
5. Select the desired network block
6. From the **left menu**, click **Edit**
7. **Owner Type**, select **Network**
8. **Owner**, select the newly created VPN network
9. Click **Submit**

After assigning an IP address to the VPN network you must apply the rules for the settings to take effect.

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **Apply Rules**
:::
::::::



## Phase 1 Configuration

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **View**
4. From the **left menu**, click **IPsec Tunnels**
5. From the **left menu**, click **New**
6. Enter a **Name** for the phase 1 configuration
7. (Optional), enter a **Description**
8. Select **Key Exchange Version**
   - **Auto&#x20;**<font color="#2166ae">**(recommended)**</font> - Uses the IKE version initiated by the remote peer.
   - **IKEv1** - Uses IKEv1.
   - **IKEv2** - Uses IKEv2.
9. Enter the **Remote Gateway**

:::Paragraph{indent="2"}
ℹ️ The WAN address of the IPsec remote peer.
:::

10. Configure **Phase 1 (Encryption)**
    - **Algorithm** - AES-256-GCM is recommended.
    - **Key Length** - Varies depending on algorithm selected.
    - **Hash&#x20;**- Varies depending on algorithm selected.
    - **DH Group** - Varies depending on algorithm selected.
    - **Lifetime&#x20;**- Auto-expiration setting for SAs
11. Configure **Phase 1 Proposal (Authentication)**
    - **Pre-Shared Key** - Can be manually entered or you may press **⭮** to generate a pre-shared key for you.
    - **Negotiation Mode**
      - **Main&#x20;**<font color="#2166ae">**(recommended)**</font> - Slower negotiation, but more secure.
      - **Aggressive&#x20;**- Faster negotiation but exposes identities.
    - **Identifier&#x20;**- The identity presented to the remote peer during IKE negotiation. When left blank, the current IP is used. Typically, the tenants WAN IP address should be entered as it's the source address from the remote peer's perspective.
    - **Peer Identifier** - The identity to expect from the remote peer; typically can be left blank to use the address currently specified as the VPN remote gateway.
12. Configure **Phase 1 Advanced Options**
    - **Connection Behavior** - defines the behavior to occur at IPsec startup.
      - **Responder Only** - Loads connection but doesn't start.
      - **On-Demand** - Loads a connection and starts it if traffic is detected between the networks.
      - **Start&#x20;**- Loads and starts the connection immediately.
    - **Force UDP Encapsulation** - When enabled, UDP encapsulation is forced, even when NAT is not detected.
    - **Rekey&#x20;**- Can be disabled to prevent local initiation of renegotiating a connection about to expire; however, it doesn't affect renegotiation requests that come from the remote peer.
    - **Margintime** - Defines the length of time to elapse before a replacement negotiation for expired keying-channel/connection. This setting is only relevant locally (remote peer does not need to match setting).
    - **Dead Peer Detection** - defines the default action to perform on timeout.
      - **Clear&#x20;**- Closes the connection.
      - **Hold&#x20;**- Monitors for new traffic and renegotiates connection if traffic between the networks is detected.
      - **Restart&#x20;**- Tries to renegotiate the connection immediately.
      - **None** - Disables sending DPD messages.
    - **DPD Delay** - Defines time internal R\_U\_There messages are sent to the peer. Only sent when there is no other traffic.
    - **DPD Failures** - Defines the maximum number of failures before automatically deleting peer connections after inactivity (does not apply to IKEv2).
13. Click **Submit**



## Phase 2 Configuration

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **View**
4. From the **left menu**, click **IPsec Tunnels**
5. Select the newly created Phase 1 Configuration
6. From the **left menu**, click **View P2s**
7. From the **left menu**, click **New**
8. Enter a **name** for the phase 2 configuration
9. Select **Mode&#x20;**(typically **Tunnel**)
10. Enter a **Local Network**, the subnet of IP addresses to include on this side of the VPN

:::Paragraph{indent="2"}
(e.g., `192.168.100.0/24`)
:::

11. Enter the **Remote Network**, the network of the remote peer in CIDR format

:::Paragraph{indent="2"}
(e.g., `10.128.1.0/24`)
:::

12. Select **Protocol**
    - **ESP&#x20;**<font color="#2166AE">**(recommended)**</font> - Encapsulating Security Payload
    - **AH** - Authentication Only
13. Select **Lifetime**, the duration of the SA established during Phase 2
14. Configure **Phase 2 (Encryption)**
    - **Algorithm** - AES-256-GCM is recommended.
    - **Key Length** - Varies depending on algorithm selected.
    - **Hash&#x20;**- Varies depending on algorithm selected.
    - **DH Group** - Varies depending on algorithm selected.
15. Click **Submit**



## Firewall & Routing Rules

The following rules are automatically created on the new VPN network. Additional network configuration may be necessary for IPsec traffic beyond the default auto-created network rules, depending on your specific network and IPsec design.

| **Direction** | **Action** | **Protocol** | **Port** |
| ------------- | ---------- | ------------ | -------- |
| Incoming      | Allow      | UDP          | 500      |
| Incoming      | Allow      | UDP          | 4500     |
| Incoming      | Allow      | ESP          | -        |
| Incoming      | Allow      | AH           | -        |

:::hint{type="info"}
These rules can be modified to further restrict traffic from specific source IP's, where appropriate.
:::



### Create NAT Translation

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **View**
4. From the **left menu**, click **Rules**
5. From the **left menu**, click **New**
6. Enter a **Name** for the rule (e.g., `NAT Translation`)
7. (Optional), Enter a **Description**
8. **Action**, select **Translate**
9. **Protocol**, select **ANY**
10. **Direction**, select **Incoming**
11. **Interface**, select **DMZ**
12. **Pin**, select **Top**
13. Configure **Source**
    1. **Type**, select **Any / None**
14. Configure **Destination**
    - <font color="#2166AE">**VIP Method**</font>
      1. **Type**, select **My IP Addresses**
      2. **IP Address**, select the desired external IP address
    - ****<font color="#2166AE">**Network Block Method**</font>
      1. **Type**, select **Network Block**
      2. **Network Block**, select the desired external IP address
15. Configure **Target**
    1. **Type**, select **My Router IP**
16. Click **Submit**

⚠️ Click **Apply Rules** to apply the changes.



### Create Outbound Route

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **View**
4. From the **left menu**, click **Rules**
5. From the **left menu**, click **New**
6. Enter a **Name** for the rule (e.g., `Default Route`)
7. Set **Action** to **Route**
8. Set **Protocol** to **ANY**
9. Set **Direction** to **Outgoing**
10. Configure **Source**
    1. **Type** to **Any / None**
11. Configure **Destination**
    1. **Type** to **Default**
12. Configure **Target**
    1. **Type** to **Other Network DMZ IP**
    2. **Target Network** to **External**
13. Click **Submit**

⚠️ Click **Apply Rules** to apply the changes.



### Create Network Route(s)

Perform these steps for each internal network you wish to route across the VPN tunnel.

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **View**
4. From the **left menu**, click **Rules**
5. From the **left menu**, click **New**
6. Enter a **Name** for the rule (e.g., `Route vlan200`)
7. **Action**, select **Route**
8. **Protocol**, select **ANY**
9. **Direction**, select **Outgoing**
10. Configure **Source**
    1. **Type**, select **Any / None**
11. Configure **Destination**
    1. **Type**, select **Custom**
    2. **Custom Filter**, Enter the network subnet
       (e.g., `192.168.200.0/24`)
12. Configure **Target**
    1. **Type**, select **Other Network DMZ IP**
    2. **Target Network**, select the desired network
13. Click **Submit**

⚠️ Click **Apply Rules** to apply the changes.



### Create NAT Exclusion(s)

Perform these steps for each internal network you wish to route across the VPN tunnel.

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **View**
4. From the **left menu**, click **Rules**
5. From the **left menu**, click **New**
6. Enter a **Name** for the rule (e.g., `NAT Exclusion vlan200`)
7. **Action**, select **Translate**
8. **Protocol**, select **ANY**
9. **Direction**, select **Outgoing**
10. **Interface**, select **DMZ**
11. **Pin**, select **Top**
12. Configure **Source**
    1. **Type**, select **Other Network DMZ IP**
    2. **Network**, select the desired network (e.g., `vlan200`)
13. Configure **Destination**
    1. **Type**, select **Custom**
    2. **Custom Filter**, enter **!=** followed by the IP address of the newly created VPN network. (e.g., `!=10.254.254.1`)
14. Configure **Target**
    1. **Type**, select **Other Router IP**
    2. **Target Network**, select the desired network (e.g., `vlan200`)
15. Click **Submit**

⚠️ Click **Apply Rules** to apply the changes.



### Create Internal Network Route(s)

Perform these steps on each internal network you wish to route across the VPN tunnel.

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the desired network (e.g., `vlan200`, `vlan210`, etc.)
3. From the **left menu**, click **View**
4. From the **left menu**, click **Rules**
5. From the **left menu**, click **New**
6. Enter a **Name** for the rule (e.g., `Route to VPN`)
7. **Action**, select **Route**
8. **Protocol**, select **ANY**
9. **Direction**, select **Outgoing**
10. Configure **Source**
    1. **Type**, select **Any / None**
11. Configure **Destination**
    1. **Type**, select **Custom**
    2. **Custom Filter**, enter the remote VPN subnet(s)
       (e.g., `10.128.1.0/24`)
       ℹ️ It's typically best practice to create separate rules for each subnet.
12. Configure **Target**
    1. **Type**, select **Other Network DMZ IP**
    2. **Target Network**, select the newly created VPN network
13. Click **Submit**

⚠️ Click **Apply Rules** to apply the changes.



### Create Firewall Rule(s)

Firewall rules must be configured in two places to allow traffic from the remote VPN network to reach your application VMs:

- **VPN Network -&#x20;**&#x43;ontrols traffic entering through the VPN and determines which internal networks it can reach.
- **Internal Networks -&#x20;**&#x43;ontrol access to the VMs themselves and define what application traffic is permitted.

On the VPN network, rules are typically broader, allowing traffic from the remote subnet to reach one or more internal networks using subnet-based and any-to-any policies where appropriate.

On the internal networks, rules should be more granular, restricting traffic based on specific source and destination IP addresses, ports, or protocols to match the requirements of the applications hosted on those VMs.

Because application requirements vary widely between environments, there is no single rule set that applies to every scenario. Firewall policies should always be designed around the specific traffic flows and security requirements of each deployment.



## Connect To Peer

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **View**
4. Scroll to the **IPsec Connections** section
5. Click the 🔌 button to initiate the connection to the remote peer
   1. Click **Yes** to confirm



## Advanced Configuration

The following settings are available for advanced IPsec configurations, but are not typically necessary. Please contact KorGrid Support for assistance with these settings.

### Edit IPsec Configuration

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the newly created VPN network
3. From the **left menu**, click **View**
4. From the **left menu**, click **Edit IPsec**
   - **Configuration Mode**
     - **Normal** <font color="#2166AE">**(recommended)**</font> - This option is typically used and includes common IPsec fields.
     - **Advanced&#x20;**- Allows for extensive or out-of-the-ordinary IPsec configuration through the use of configuration (conf) files.
   - **Unique IDs**
     - **Yes** - Keep particular participant IDs unique. (e.g., Replace)
     - **Never&#x20;**- Will ignore INITIAL\_CONTACT notify, will not replace old IKE\_SAs.
     - **No&#x20;**- Will replace IKE\_SAs only upon INITIAL\_CONTACT notify.
   - **Propose IPComp Compressions** - Utilizes a special protocol designed to compress the payload of IP packets. **Must be supported by the remote peer**.
   - **Exclude My Network** - This setting should typically be enabled.
   - **Cisco Extensions** - This setting should remain disabled unless specifically needed to support configuration of the remote IPsec peer.
   - **Unencrypted ID and HASH payloads** - It's generally recommended to keep this option disabled. Transmitting ID and HASH payloads unencrypted during initial exchange introduces several security vulnerabilities.
   - **MSS Clamp** - In some situations, MSS clamping can improve performance in IPsec tunnels. However, it's critical to thoroughly understand your network to calculate and set MSS accurately. An incorrect setting can lead to suboptimal performance and/or packet loss.
   - **Strict CRL Policy** - A strict CRL (certificate revocation list) policy will not accept revoked certificates during authentication.
   - **Make Before Break** - New SAs are established while old ones are still active; removing old SAs only when the new ones are ready.
5. Click **Submit**

***

# WireGuard

WireGuard is a modern, open-source VPN software and tunnel protocol that provides fast communication, utilizing state-of-the-art cryptography. WireGuard has been integrated directly into our platform for the implementation of secure tunnels with minimal setup effort. These secure tunnels can be used for both remote user access and site-to-site connectivity.

&#x20;

## Interface Configuration

WireGuard is attached to one network. This should be a network that has access to all networks which the WireGuard VPN should reach.

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the desired network
3. From the **left menu**, click **View**
4. From the **left menu**, click **WireGuard (VPN)**
5. From the **left menu**, click **New Interface**
6. Enter a **Name** for the VPN interface
7. (Optional), enter a **Description**
8. Enter an **IP Address** - defines the IP/network address for the interface.

:::Paragraph{indent="2"}
ℹ️ This should be a unique address space that has been specifically set aside for the VPN and will not conflict with addressing on participating networks within the tenant or VPN peers.
:::

:::BlockQuote{indent="2"}
Example: Internal Network that uses an addressing scheme of `192.168.0.1/24` and a peer that uses an addressing scheme of `10.10.100.0/24` could have a WireGuard interface that uses `172.16.1.1/24`.
:::

9. (Optional), specify a **Listen Port**, can typically be left to the default `51820`
10. Enter a **Private Key**, can typically be left blank to allow the key pair to auto-generate, however, a specific private key can be entered if desired

:::Paragraph{indent="2"}
⚠️ WireGuard requires base64-encoded public and private keys. Any manually entered private key must be a complete base64 key. [Random Base64 Generator](https://www.convertsimple.com/random-base64-generator/).
:::

11. (Optional), enter an **Endpoint IP** - the external address to which a peer will connect
12. (Optional), toggle **Configure Firewall** <font color="#2166ae">**(recommended)**</font> - automatically configure PAT rules on the External Network
13. (Optional), toggle **Auto-Apply Firewall Rules&#x20;**<font color="#2166ae">**(recommended)**</font> - automatically apply new firewall rules on the WireGuard network and the External Network
14. Click **Submit**



## Create Peer Definition(s)

A peer definition must be created for each entity that will connect to your WireGuard instance. For example, to create a site-to-site VPN implementation, each side would have a WireGuard interface and configure the other as a peer using the public key from the other side in the peer record. To create a remote access system for users, a peer record is created for each user that will connect, each with a different public key.

1. From the **Top Menu**, click **Networks** -> **List**
2. Select the desired network
3. From the **left menu**, click **View**
4. From the **left menu**, click **WireGuard (VPN)**
5. From the **left menu**, click **New Peer**
6. Enter a **Name** for the peer
7. (Optional), enter a **Description**
8. Toggle **Auto-Generate Peer Configuration&#x20;**<font color="#2166ae">**(recommended)**</font> - creates a configuration file to be used by the remote access users
9. Enter an **Endpoint** - the external-facing IP or hostname of the peer; the address from which this system would access the peer
10. (Optional), specify a **Listen Port**, can typically be left to the default `51820`
11. Enter a **Peer IP** - the IP address that routes the traffic here; typically, this is the internal address assigned to the local interface on this peer
12. Enter a **Public Key** - the base64 public key from the peer
13. (Optional), Enter a **Preshared Key** - can be entered to provide an extra layer of security
14. Select **Configure Firewall**
    - **Site-to-Site** - creates firewall rules for a site peer
    - **Remote User** - creates firewall rules for a remote user peer
    - **Don't Create Rules** - doesn't auto-generate any firewall rules; rules must be configured manually
15. Set **Keepalive** - by default this is set to `0`, which means keepalives are disabled. It's not generally necessary to change this value.
16. Configure **Allowed IPs** - one or more IP address segments, in CIDR format

:::Paragraph{indent="2"}
(e.g., `10.1.2.0/24`)
:::

17. Click **Submit**

⚠️ Click **Apply Rules** to apply the changes.



## Create Cluster-to-Cluster Tunnel

- **On Cluster 1**
  1. Create an [Interface Configuration](https://docs.korgrid.com/vpns#interface-configuration)
  2. Copy the generated Public Key (for the interface) for later use
- **On Cluster 2**
  1. Create an [Interface Configuration](https://docs.korgrid.com/vpns#interface-configuration)
  2. [Create Peer Definition](https://docs.korgrid.com/vpns#create-peer-definitions)
     1. Set **Public Key** to the generated public key you copied from cluster 1
     2. Set **Allowed IPs** to include the address of the **WireGuard Interface** from cluster 1
  3. Copy the generated **Public Key** for later use
- On **Cluster 1**
  1. [Create Peer Definition](https://docs.korgrid.com/vpns#create-peer-definitions)
     1. Set **Public Key** to the generated public key you copied from cluster 2
     2. Set **Allowed IPs** to include the address of the **WireGuard Interface** from cluster 2
- On **Cluster 1** & **Cluster 2**
  1. ⚠️ Click **Apply Rules** to apply the changes.



## Create Remote User Access Tunnel

1. Create an [Interface Configuration](https://docs.korgrid.com/vpns#interface-configuration)
2. From the **left menu**, click **New Peer**
3. Enter a **Name** for the peer, such as the remote user's name
4. (Optional), enter a **Description**
5. Toggle **Auto-Generate Peer Configuration**
6. Enter the **Endpoint** for the peer, the external-facing IP address, hostname, or URL this tunnel will use to communicate with the peer
7. Set **Configure Firewall** to **Remote User**
8. Click **Submit**

****

### Configure Client

1. On the peer record, download the configuration file by clicking the ⭳ **Download** button
2. [Install WireGuard software](https://www.wireguard.com/install/) on the client machine
3. After installation, launch WireGuard client
4. Click **Add Tunnel**
5. Open the configuration file you downloaded earlier
6. Click **Activate**
