> ## Documentation Index
> Fetch the complete documentation index at: https://docs.macstadium.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 1. AWS Side of the VPN Tunnel

> Configure the AWS side of an IPsec site-to-site VPN: create a customer gateway, virtual private gateway, and VPN connection in Amazon VPC.

How to configure the AWS side of your VPN tunnel between AWS and Orka.

> #### **You need:**
>
> * The IP address for the `FW1-Outside` network from your [IP Plan](/macstadium/macstadium-overview/ip-plan).
> * The [CIDR notation](https://www.digitalocean.com/community/tutorials/understanding-ip-addresses-subnets-and-cidr-notation-for-networking#cidr-notation) for the `Private-1` network from your [IP Plan](/macstadium/macstadium-overview/ip-plan). Most likely: `10.221.188.0/24`.

To establish a stable, persistent connection between an Amazon Virtual Private Cloud (Amazon VPC) and your Orka cluster, you need to configure an IPsec site-to-site VPN (VPN tunnel) between the two.

Routing from Amazon to Orka is static.

## Step 1: Log in to your VPC service

1. Log in to your AWS Management Console and access your VPC service. In the top right corner of the screen, make sure that you're working in the correct region.
2. In the **Find Services** bar, type `VPC` and navigate to the service.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763351067.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=2f0e33d3972583051a9f04b0fe50936b" alt="AWS Management Console Find Services bar with VPC typed" width="1562" height="898" data-path="images/attachments/28401763351067.png" />

## Step 2: Create a customer gateway

In Amazon, the [customer gateway](https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html#VPN) represents the Orka end of the tunnel.

1. In the VPC service sidebar, locate the **Virtual Private Network** menu and select **Customer Gateways**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763352219.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=3cc74c163f8c4125f293a95cbb82b385" alt="AWS VPC sidebar with Customer Gateways selected" width="2626" height="2168" data-path="images/attachments/28401763352219.png" />

2. Click **Create Customer Gateway**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401777600795.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=9b1596ef76114edf24aaeb0518022407" alt="Create Customer Gateway button in AWS VPC console" width="1854" height="992" data-path="images/attachments/28401777600795.png" />

3. Fill in the form.
   1. Provide a **Name**. Set a name that helps you identify the gateway easily.
   2. Select **Static** routing.
   3. In the **IP Address** text box, provide the IP address for the `FW1-Outside` network from your [IP Plan](/macstadium/macstadium-overview/ip-plan).
   4. Ignore the remaining settings.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763358107.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=94b6907e1531de779f8aaed6469cc77f" alt="Create Customer Gateway form with name, routing, and IP address fields" width="1830" height="1046" data-path="images/attachments/28401763358107.png" />

4. Click **Create Customer Gateway**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763363995.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=43f19be227a510586b7e3f114fcd2f06" alt="AWS console confirmation of customer gateway created successfully" width="2030" height="570" data-path="images/attachments/28401763363995.png" />

## Step 3: Set up a virtual private gateway

In Amazon, the [virtual private gateway](https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html#VPN) represents the Amazon end of the tunnel.

1. In the VPC service sidebar, locate the **Virtual Private Network** menu and select **Virtual Private Gateways**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763366043.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=68e32f698db54166bf93b1277034b2ca" alt="AWS VPC sidebar with Virtual Private Gateways selected" width="2614" height="2168" data-path="images/attachments/28401763366043.png" />

2. Click **Create Virtual Private Gateway**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763368347.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=6916342bc1fd309189cccdaabd9bba17" alt="Create Virtual Private Gateway button in AWS VPC console" width="1852" height="878" data-path="images/attachments/28401763368347.png" />

3. Fill in the form.
   1. Provide a **Name tag**. Set a name that helps you identify the gateway easily.
   2. Select **Amazon default ASN**
   3. Click **Create Virtual Private Gateway**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401777617051.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=532d9e10dc6484f3f1063cdbdfe5e56d" alt="Create Virtual Private Gateway form with name tag and ASN fields" width="1848" height="660" data-path="images/attachments/28401777617051.png" />

4. On the **Virtual Private Gateways** dashboard, right-click the newly created virtual private gateway and select **Attach to VPC**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763373595.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=b970aee3f40922bc8f7b6a9af709cfd5" alt="Virtual Private Gateways dashboard with Attach to VPC option in context menu" width="2180" height="678" data-path="images/attachments/28401763373595.png" />

5. Select your VPC from the drop-down menu and click **Yes, Attach**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401777624475.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=da8623e7ab48ce0021664c09b3296c1f" alt="Attach to VPC dialog with VPC dropdown and Yes Attach button" width="1850" height="664" data-path="images/attachments/28401777624475.png" />

Next, you need to manually enable [route propagation](https://docs.aws.amazon.com/vpn/latest/s2svpn/VPNRoutingTypes.html) for the virtual private gateway.

1. In the VPC service sidebar, locate the **Virtual Private Cloud** menu and select **Route Tables**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763377691.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=1687402aa190d525dde52413ec1809d7" alt="AWS VPC sidebar with Route Tables selected" width="2640" height="2168" data-path="images/attachments/28401763377691.png" />

2. In the list of routing tables, select the main route table for your VPC.
3. At the bottom of the screen, select **Route Propagation**. If your virtual private gateway is not listed, make sure that it's attached to the VPC.
4. Click **Edit route propagation**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763378843.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=aafd68c9deb856401344bbbe022579f8" alt="Route Propagation tab showing Edit route propagation button" width="2188" height="1044" data-path="images/attachments/28401763378843.png" />

5. Select the **Propagate** checkbox and click **Save**.

## Step 4: Create the tunnel

After you have a customer gateway and a virtual private gateway in place, you can configure the tunnel.

1. In the VPC service sidebar, locate the **Virtual Private Network** menu and select **Site-to-Site VPN Connections**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401777633563.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=2e0f3d9c2ee227f628a0acf26ca366d4" alt="AWS VPC sidebar with Site-to-Site VPN Connections selected" width="2640" height="2168" data-path="images/attachments/28401777633563.png" />

2. Click **Create VPN Connection**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763385883.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=918d475502ae3b6a9b0695fc4a9f9fe6" alt="Create VPN Connection button in AWS VPC console" width="1854" height="878" data-path="images/attachments/28401763385883.png" />

3. Fill in the form.
   1. Provide **Name tag**.
   2. For **Target Gateway Type** , select **Virtual Private Gateway** , and from the **Virtual Private Gateway** drop-down menu, select the virtual private gateway you created earlier.
   3. Select that you want to use an **Existing** customer gateway, and from the **Customer Gateway ID** drop-down menu, select the customer gateway that you created earlier.
   4. For **Routing Options** , select **Static**.
   5. In **Static IP Prefixes** , provide the [CIDR notation](https://www.digitalocean.com/community/tutorials/understanding-ip-addresses-subnets-and-cidr-notation-for-networking#cidr-notation) for your `Private-1` network. Most likely: `10.221.188.0/24`.
   6. Ignore the remaining options (not shown on the screenshot).

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401763388315.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=1b9cb14e7e7e7450f66faeb58836b3ce" alt="Create VPN Connection form with gateway, routing, and CIDR prefix fields" width="2022" height="1658" data-path="images/attachments/28401763388315.png" />

4. Click **Create VPN Connection**.

<img src="https://mintcdn.com/macstadiuminc/9YdlTfp9PivQkqG1/images/attachments/28401777645083.png?fit=max&auto=format&n=9YdlTfp9PivQkqG1&q=85&s=0bbaf6513711f6bc9ffbc1e164f2ba4e" alt="283f047-create-vpn-success.png" width="1842" height="570" data-path="images/attachments/28401777645083.png" />

## Step 5: Ensure that AWS allows inbound traffic

Based on your requirements and current setup, you might need to enable inbound traffic from Orka to AWS.

See [Amazon VPC Documentation: Security Groups for Your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) and [Amazon VPC Documentation: Network ACLs](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html).
