Step 9: Creating the VPN
The VPN (Virtual Private Network) connection links your local network to your AWS VPC. This step involves creating three components: Customer Gateway, Virtual Private Gateway, and VPN Connection.
Overview of VPN Components
| Component | Description |
|---|---|
| Customer Gateway | Represents your local router in AWS |
| Virtual Private Gateway | The AWS-side VPN endpoint |
| VPN Connection | The tunnel linking both gateways |
Create a Customer Gateway
- Navigate to VPC Dashboard and select Customer Gateways.
- Click Create Customer Gateway.
- Enter the following settings:
| Setting | Value |
|---|---|
| Name tag | My-Company-CGW |
| Routing | Static |
| IP Address | Your router's public/WAN IP address |
- Click Create Customer Gateway.
Important: The IP address must be a static public IP assigned by your ISP. Contact your Internet Service Provider if you need to request a static IP assignment.
Create a Virtual Private Gateway
- Navigate to VPC Dashboard and select Virtual Private Gateways.
- Click Create Virtual Private Gateway.
- Enter the name tag: My-Company-VGW
- Click Create Virtual Private Gateway.
- Select the newly created gateway.
- Click Actions and select Attach to VPC.
- Select My-Company-VPC and click Attach.
Create the VPN Connection
- Navigate to VPC Dashboard and select VPN Connections.
- Click Create VPN Connection.
- Enter the following settings:
| Setting | Value |
|---|---|
| Name tag | My-Company-VPN |
| Virtual Private Gateway | My-Company-VGW |
| Customer Gateway | My-Company-CGW |
| Routing Options | Static |
| Static IP Prefixes | 192.168.1.0/24 |
- Click Create VPN Connection.
Important: The Static IP Prefixes value represents your local network subnet. The example uses 192.168.1.0/24. You must change this to reflect your actual local network subnet.
Understanding the VPN Tunnels
AWS creates two VPN tunnels for redundancy. Each tunnel has:
- Unique outside IP addresses (AWS public endpoints)
- Inside IP addresses for tunnel communication
- Pre-shared keys for authentication
You will configure your router to connect to at least one of these tunnels.