s2s VPN User Guide
s2s VPN User Guide
User Guide
AWS Site-to-Site VPN User Guide
Amazon's trademarks and trade dress may not be used in connection with any product or service that is not
Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or
discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may
or may not be affiliated with, connected to, or sponsored by Amazon.
AWS Site-to-Site VPN User Guide
Table of Contents
What is Site-to-Site VPN ..................................................................................................................... 1
Concepts ................................................................................................................................... 1
Working with Site-to-Site VPN ..................................................................................................... 1
Pricing ...................................................................................................................................... 2
How AWS Site-to-Site VPN Works ........................................................................................................ 3
Components of Your Site-to-Site VPN .......................................................................................... 3
Virtual Private Gateway ...................................................................................................... 3
AWS Transit Gateway .......................................................................................................... 3
Customer Gateway ............................................................................................................. 3
Customer Gateway Device ................................................................................................... 4
Site-to-Site VPN Categories ......................................................................................................... 4
Site-to-Site VPN Tunnel Options .................................................................................................. 4
Site-to-Site VPN Tunnel Authentication Options ............................................................................ 8
Pre-Shared Keys ................................................................................................................. 8
Private Certificate from AWS Certificate Manager Private Certificate Authority ........................... 8
Customer Gateway Options ......................................................................................................... 8
Site-to-Site VPN Routing Options ................................................................................................ 9
Static and Dynamic Routing ............................................................................................... 10
Route Tables and VPN Route Priority .................................................................................. 10
Getting Started ................................................................................................................................ 12
Create a Customer Gateway ....................................................................................................... 12
Create a Virtual Private Gateway ................................................................................................ 13
Enable Route Propagation in Your Route Table ............................................................................ 13
Update Your Security Group ...................................................................................................... 14
Create a Site-to-Site VPN Connection and Configure the Customer Gateway Device ........................... 15
Configure the Customer Gateway Device ..................................................................................... 15
Editing Static Routes for a Site-to-Site VPN Connection ................................................................ 16
Architectures .................................................................................................................................... 17
Single and Multiple Connection Examples ................................................................................... 17
Single Site-to-Site VPN Connection .................................................................................... 17
Single Site-to-Site VPN Connection with a Transit Gateway .................................................... 17
Multiple Site-to-Site VPN Connections ................................................................................ 18
Multiple Site-to-Site VPN Connections with a Transit Gateway ............................................... 19
Secure Communication Between Sites Using VPN CloudHub .......................................................... 19
Using Redundant Site-to-Site VPN Connections to Provide Failover ................................................. 21
Working with Site-to-Site VPN ........................................................................................................... 24
Identifying a Site-to-Site VPN Connection ................................................................................... 24
Migrating from AWS Classic VPN to AWS VPN .............................................................................. 25
Testing the Site-to-Site VPN Connection ..................................................................................... 26
Deleting a Site-to-Site VPN Connection ...................................................................................... 27
Modifying a Site-to-Site VPN Connection's Target Gateway ............................................................ 28
Step 1: Create the Transit Gateway ..................................................................................... 29
Step 2: Delete Your Static Routes (Required for a Static VPN Connection Migrating to a Transit
Gateway) ......................................................................................................................... 29
Step 3: Migrate to a New Gateway ..................................................................................... 30
Step 4: Update VPC Route Tables ....................................................................................... 30
Step 5: Update the Transit Gateway Routing (Required When the New Gateway is a Transit
Gateway) ......................................................................................................................... 31
Step 6: Update the Customer Gateway ASN (Required When the New Gateway has a Different
ASN from the Old Gateway) .............................................................................................. 31
Modifying Site-to-Site VPN Tunnel Options ................................................................................. 31
Changing the Customer Gateway for a Site-to-Site VPN Connection ................................................ 32
Replacing Compromised Credentials ........................................................................................... 32
Rotating Site-to-Site VPN Tunnel Endpoint Certificates ................................................................. 33
iii
AWS Site-to-Site VPN User Guide
iv
AWS Site-to-Site VPN User Guide
Concepts
Although the term VPN connection is a general term, in this documentation, a VPN connection refers
to the connection between your VPC and your own on-premises network. Site-to-Site VPN supports
Internet Protocol security (IPsec) VPN connections.
Your Site-to-Site VPN connection is either an AWS Classic VPN or an AWS VPN. For more information, see
Site-to-Site VPN Categories (p. 4).
Important
We currently do not support IPv6 traffic through a Site-to-Site VPN connection.
Concepts
The following are the key concepts for Site-to-Site VPN:
• VPN connection: A secure connection between your on-premises equipment and your VPCs.
• VPN tunnel: An encrypted link where data can pass from the customer network to or from AWS.
Each VPN connection includes two VPN tunnels which you can simultaneously use for high availability.
• Customer gateway: An AWS resource which provides information to AWS about your customer
gateway device.
• Customer gateway device: A physical device or software application on your side of the Site-to-Site
VPN connection.
• AWS Management Console— Provides a web interface that you can use to access your Site-to-Site
VPN resources.
• AWS Command Line Interface (AWS CLI) — Provides commands for a broad set of AWS services,
including Amazon VPC, and is supported on Windows, macOS, and Linux. For more information, see
AWS Command Line Interface.
• AWS SDKs — Provide language-specific APIs and takes care of many of the connection details, such
as calculating signatures, handling request retries, and error handling. For more information, see AWS
SDKs.
• Query API— Provides low-level API actions that you call using HTTPS requests. Using the Query API
is the most direct way to access Amazon VPC, but it requires that your application handle low-level
details such as generating the hash to sign the request, and error handling. For more information, see
the Amazon EC2 API Reference.
1
AWS Site-to-Site VPN User Guide
Pricing
Pricing
For information about pricing, see VPN pricing.
2
AWS Site-to-Site VPN User Guide
Components of Your Site-to-Site VPN
A Site-to-Site VPN connection consists of the following components. For more information about Site-
to-Site VPN limits, see Amazon VPC Limits in the Amazon VPC User Guide.
Contents
• Virtual Private Gateway (p. 3)
• AWS Transit Gateway (p. 3)
• Customer Gateway (p. 3)
• Customer Gateway Device (p. 4)
When you create a virtual private gateway, you can specify the private Autonomous System Number
(ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway
is created with the default ASN (64512). You cannot change the ASN after you've created the virtual
private gateway. To check the ASN for your virtual private gateway, view its details in the Virtual Private
Gateways screen in the Amazon VPC console, or use the describe-vpn-gateways AWS CLI command.
Note
If you create your virtual private gateway before 2018-06-30, the default ASN is 17493 in the
Asia Pacific (Singapore) region, 10124 in the Asia Pacific (Tokyo) region, 9059 in the EU (Ireland)
region, and 7224 in all other regions.
Customer Gateway
A customer gateway resource in AWS, which provides information to AWS about your the section called
“Customer Gateway Device” (p. 4). For information about customer gateway options, see the section
called “Customer Gateway Options” (p. 8).
To use Amazon VPC with a Site-to-Site VPN connection, you or your network administrator must also
configure the customer gateway device or application in your remote network. When you create the
3
AWS Site-to-Site VPN User Guide
Customer Gateway Device
Site-to-Site VPN connection, we provide you with the required configuration information and your
network administrator typically performs this configuration. For information about the customer
gateway requirements and configuration, see the Your Customer Gateway in the Amazon VPC Network
Administrator Guide.
The VPN tunnel comes up when traffic is generated from your side of the Site-to-Site VPN connection.
The virtual private gateway is not the initiator; your customer gateway must initiate the tunnels. If your
Site-to-Site VPN connection experiences a period of idle time (usually 10 seconds, depending on your
configuration), the tunnel may go down. To prevent this, you can use a network monitoring tool to
generate keepalive pings; for example, by using IP SLA.
For information about identifying and migrating your connection, see the section called “Identifying a
Site-to-Site VPN Connection” (p. 24) and the section called “Migrating from AWS Classic VPN to AWS
VPN” (p. 25).
The following diagram shows the two tunnels of the Site-to-Site VPN connection.
4
AWS Site-to-Site VPN User Guide
Site-to-Site VPN Tunnel Options
When you create a Site-to-Site VPN connection, you download a configuration file specific to your
customer gateway device that contains information for configuring the device, including information for
configuring each tunnel. You can optionally specify some of the tunnel options yourself when you create
the Site-to-Site VPN connection. Otherwise, AWS provides default values.
The following table describes the tunnel options that you can configure.
Inside tunnel CIDR The range of inside IP addresses A size /30 CIDR block from the
for the VPN tunnel. You can 169.254.0.0/16 range.
specify a size /30 CIDR block
from the 169.254.0.0/16
5
AWS Site-to-Site VPN User Guide
Site-to-Site VPN Tunnel Options
• 169.254.0.0/30
• 169.254.1.0/30
• 169.254.2.0/30
• 169.254.3.0/30
• 169.254.4.0/30
• 169.254.5.0/30
• 169.254.169.252/30
Phase 1 Diffie-Hellman (DH) The DH group numbers that are 2, 14, 15, 16, 17, 18, 22, 23, 24
group numbers permitted for the VPN tunnel for
phase 1 of the IKE negotiations.
You can specify one or more of
the default values.
Phase 2 Diffie-Hellman (DH) The DH group numbers that are 2, 5, 14, 15, 16, 17, 18, 22, 23,
group numbers permitted for the VPN tunnel for 24
phase 2 of the IKE negotiations.
You can specify one or more of
the default values.
Phase 1 integrity algorithms The integrity algorithms that are SHA-1, SHA2-256
permitted for the VPN tunnel for
phase 1 of the IKE negotiations.
You can specify one or more of
the default values.
Phase 2 integrity algorithms The integrity algorithms that are SHA-1, SHA2-256
permitted for the VPN tunnel for
phase 2 of the IKE negotiations.
You can specify one or more of
the default values.
6
AWS Site-to-Site VPN User Guide
Site-to-Site VPN Tunnel Options
Phase 1 lifetime (seconds) The lifetime in seconds for phase 28,800 (8 hours)
1 of the IKE negotiations. You
can specify a number between
900 and 28,800.
Phase 2 lifetime (seconds) The lifetime in seconds for phase 3,600 (1 hour)
2 of the IKE negotiations. You
can specify a number between
900 and 3,600. The number that
you specify must be less than
the number of seconds for the
phase 1 lifetime.
Rekey margin time (seconds) The margin time in seconds 540 (9 minutes)
before the phase 2 lifetime
expires, during which the AWS
side of the VPN connection
performs an IKE rekey.
7
AWS Site-to-Site VPN User Guide
Site-to-Site VPN Tunnel Authentication Options
You can modify tunnel options after you create the Site-to-Site VPN connection. You cannot configure
tunnel options for an AWS Classic VPN connection.
Pre-Shared Keys
A pre-shared key is the default authentication option.
A pre-shared key is a Site-to-Site VPN tunnel option that you can specify when you create a Site-to-Site
VPN tunnel.
A pre-shared key is a string that you enter when you configure your customer gateway device. If you do
not specify a string, we auto-generate one for you.
You must create a private certificate from a subordinate CA using AWS Certificate Manager Private
Certificate Authority. For information about creating a private certificate, see Creating and Managing a
Private CA in the AWS Certificate Manager Private Certificate Authority User Guide.
You must create a service-link role to generate and use the certificate for the AWS side of the Site-to-Site
VPN tunnel endpoint. For more information, see the section called “Permissions Granted by the Service-
Linked Role” (p. 37).
After you generate the private certificate, you specify the certificate when you create the customer
gateway, and then apply it to your customer gateway device.
If you do not specify the IP address of your customer gateway device, we do not check the IP address.
This operation allows you to move the customer gateway device to a different IP address without having
to re-configure the VPN connection.
Item Description
(Optional) Internet-routable IP address (static) of The public IP address value must be static. If your
the customer gateway devices external interface. customer gateway is behind a network address
translation (NAT) device that's enabled for NAT
traversal (NAT-T), use the public IP address of
8
AWS Site-to-Site VPN User Guide
Site-to-Site VPN Routing Options
Item Description
your NAT device, and adjust your firewall rules to
unblock UDP port 4500.
The type of routing—static or dynamic. For more information, see Site-to-Site VPN
Routing Options (p. 9).
(Dynamic routing only) Border Gateway Protocol You can use an existing ASN assigned to your
(BGP) Autonomous System Number (ASN) of the network. If you don't have one, you can use a
customer gateway. private ASN (in the 64512–65534 range).
(Optional) Private certificate from a subordinate If you want to use certificate based
CA using AWS Certificate Manager (ACM) authentication, provide the ARN of an ACM private
certificate that will be used on your customer
gateway device.
• Specify the type of routing that you plan to use (static or dynamic)
• Update the route table for your subnet
There are limits on the number of routes that you can add to a route table. For more information, see the
Route Tables section in Amazon VPC Limits in the Amazon VPC User Guide.
9
AWS Site-to-Site VPN User Guide
Static and Dynamic Routing
When you use a BGP device, you don't need to specify static routes to the Site-to-Site VPN connection
because the device uses BGP to advertise its routes to the virtual private gateway. If you use a device that
supports BGP advertising, then you cannot specify static routes, If you use a device that doesn't support
BGP, you must select static routing and enter the routes (IP prefixes) for your network that should be
communicated to the virtual private gateway.
We recommend that you use BGP-capable devices, when available, because the BGP protocol offers
robust liveness detection checks that can assist failover to the second VPN tunnel if the first tunnel goes
down. Devices that don't support BGP may also perform health checks to assist failover to the second
tunnel when needed.
Only IP prefixes that are known to the virtual private gateway, whether through BGP advertisements or
static route entry, can receive traffic from your VPC. The virtual private gateway does not route any other
traffic destined outside of received BGP advertisements, static route entries, or its attached VPC CIDR.
When a virtual private gateway receives routing information, it uses path selection to determine how to
route traffic to your remote network. Longest prefix match applies; otherwise, the following rules apply:
• If any propagated routes from a Site-to-Site VPN connection or AWS Direct Connect connection
overlap with the local route for your VPC, the local route is most preferred even if the propagated
routes are more specific.
• If any propagated routes from a Site-to-Site VPN connection or AWS Direct Connect connection
have the same destination CIDR block as other existing static routes (longest prefix match cannot
be applied), we prioritize the static routes whose targets are an Internet gateway, a virtual private
gateway, a network interface, an instance ID, a VPC peering connection, a NAT gateway, a transit
gateway, or a VPC endpoint.
If you have overlapping routes within a Site-to-Site VPN connection and longest prefix match cannot be
applied, then we prioritize the routes as follows in the Site-to-Site VPN connection, from most preferred
to least preferred:
In this example, your route table has a static route to an internet gateway (that you added manually),
and a propagated route to a virtual private gateway. Both routes have a destination of 172.31.0.0/24.
In this case, all traffic destined for 172.31.0.0/24 is routed to the internet gateway — it is a static
route and therefore takes priority over the propagated route.
10
AWS Site-to-Site VPN User Guide
Route Tables and VPN Route Priority
Destination Target
10.0.0.0/16 Local
172.31.0.0/24 igw-11aa22bb
11
AWS Site-to-Site VPN User Guide
Create a Customer Gateway
Getting Started
Use the following procedures to manually set up the AWS Site-to-Site VPN connection. Alternatively, you
can let the VPC creation wizard take care of many of these steps for you. For more information about
using the VPC creation wizard to set up the virtual private gateway, see Scenario 3: VPC with Public and
Private Subnets and AWS Site-to-Site VPN Access or Scenario 4: VPC with a Private Subnet Only and
AWS Site-to-Site VPN Access in the Amazon VPC User Guide.
These procedures assume that you have a VPC with one or more subnets.
If you plan to use a private certificate to authenticate your VPN, create a private certificate from a
subordinate CA using AWS Certificate Manager Private Certificate Authority. For information about
creating a private certificate, see Creating and Managing a Private CA in the AWS Certificate Manager
Private Certificate Authority User Guide.
Note
You must specify either an IP address, or an Amazon Resource Name of the private certificate.
• (Optional) For Name, enter a name for your customer gateway. Doing so creates a tag with a key
of Name and the value that you specify.
• For Routing, select the routing type.
• For dynamic routing, for BGP ASN, enter the Border Gateway Protocol (BGP) Autonomous System
Number (ASN).
• (Optional) For IP Address, type the static, internet-routable IP address for your customer gateway
device. If your customer gateway is behind a NAT device that's enabled for NAT-T, use the public IP
address of the NAT device.
Note
This is optional when you use a private certificate for VPN connections to a virtual private
gateway (VGW).
• (Optional) If you want to use a private certificate, for Certificate ARN, choose the Amazon
Resource Name of the private certificate.
12
AWS Site-to-Site VPN User Guide
Create a Virtual Private Gateway
After you create a virtual private gateway, you must attach it to your VPC.
1. In the navigation pane, choose Virtual Private Gateways, Create Virtual Private Gateway.
2. (Optional) Enter a name for your virtual private gateway. Doing so creates a tag with a key of Name
and the value that you specify.
3. For ASN, leave the default selection to use the default Amazon ASN. Otherwise, choose Custom ASN
and enter a value. For a 16-bit ASN, the value must be in the 64512 to 65534 range. For a 32-bit
ASN, the value must be in the 4200000000 to 4294967294 range.
4. Choose Create Virtual Private Gateway.
5. Select the virtual private gateway that you created, and then choose Actions, Attach to VPC.
6. Select your VPC from the list and choose Yes, Attach.
To attach a virtual private gateway to a VPC using the command line or API
For static routing, the static IP prefixes that you specify for your VPN configuration are propagated to the
route table when the status of the Site-to-Site VPN connection is UP. Similarly, for dynamic routing, the
BGP-advertised routes from your customer gateway are propagated to the route table when the status
of the Site-to-Site VPN connection is UP.
13
AWS Site-to-Site VPN User Guide
Update Your Security Group
Note
If your connection is interrupted, any propagated routes in your route table are not
automatically removed. You may have to disable route propagation to remove the propagated
routes; for example, if you want traffic to fail over to a static route.
1. In the navigation pane, choose Route Tables, and then select the route table that's associated with
the subnet. By default, this is the main route table for the VPC.
2. On the Route Propagation tab in the details pane, choose Edit, select the virtual private gateway
that you created in the previous procedure, and then choose Save.
Note
For static routing, if you do not enable route propagation, you must manually enter the static
routes used by your Site-to-Site VPN connection. To do this, select your route table, choose
Routes, Edit. For Destination, add the static route used by your Site-to-Site VPN connection. For
Target, select the virtual private gateway ID, and choose Save.
1. In the navigation pane, choose Route Tables, and then select the route table that's associated with
the subnet.
2. Choose Route Propagation, Edit. Clear the Propagate check box for the virtual private gateway, and
choose Save.
To add rules to your security group to enable inbound SSH, RDP and ICMP access
1. In the navigation pane, choose Security Groups, and then select the default security group for the
VPC.
2. On the Inbound tab in the details pane, add rules that allow inbound SSH, RDP, and ICMP access
from your network, and then choose Save. For more information about adding inbound rules, see
Adding, Removing, and Updating Rules in the Amazon VPC User Guide.
For more information about working with security groups using the AWS CLI, see Security Groups for
Your VPC in the Amazon VPC User Guide.
14
AWS Site-to-Site VPN User Guide
Create a Site-to-Site VPN Connection and
Configure the Customer Gateway Device
1. In the navigation pane, choose Site-to-Site VPN Connections, Create VPN Connection.
2. Complete the following information, and then choose Create VPN Connection:
• (Optional) For Name tag, enter a name for your Site-to-Site VPN connection. Doing so creates a
tag with a key of Name and the value that you specify.
• Select the virtual private gateway that you created earlier.
• Select the customer gateway that you created earlier.
• Select one of the routing options based on whether your VPN router supports Border Gateway
Protocol (BGP):
• If your VPN router supports BGP, choose Dynamic (requires BGP).
• If your VPN router does not support BGP, choose Static. For Static IP Prefixes, specify each IP
prefix for the private network of your Site-to-Site VPN connection.
• Under Tunnel Options, you can optionally specify the following information for each tunnel:
• A size /30 CIDR block from the 169.254.0.0/16 range for the inside tunnel IP addresses.
• The IKE pre-shared key (PSK). The following versions are supported: IKEv1 or IKEv2.
• Advanced tunnel information, which includes the encryption algorithms for phases 1 and 2 of
the IKE negotiations, the integrity algorithms for phases 1 and 2 of the IKE negotiations, the
Diffie-Hellman groups for phases 1 and 2 of the IKE negotiations, the IKE version, the phase
1 and 2 lifetimes, the rekey margin time, the rekey fuzz, the replay window size, and the dead
peer detection interval.
For more information about these options, see Site-to-Site VPN Tunnel Options for Your Site-to-
Site VPN Connection (p. 4).
It may take a few minutes to create the Site-to-Site VPN connection. When it's ready, select the
connection and choose Download Configuration.
3. In the Download Configuration dialog box, select the vendor, platform, and software that
corresponds to your customer gateway device or software, and then choose Yes, Download.
15
AWS Site-to-Site VPN User Guide
Editing Static Routes for a Site-to-Site VPN Connection
Note
If you have not enabled route propagation for your route table, you must manually update
the routes in your route table to reflect the updated static IP prefixes in your Site-to-Site VPN
connection. For more information, see Enable Route Propagation in Your Route Table (p. 13).
16
AWS Site-to-Site VPN User Guide
Single and Multiple Connection Examples
• the section called “Single and Multiple Connection Examples” (p. 17)
• the section called “Using Redundant Site-to-Site VPN Connections to Provide Failover” (p. 21)
• the section called “Secure Communication Between Sites Using VPN CloudHub” (p. 19)
17
AWS Site-to-Site VPN User Guide
Multiple Site-to-Site VPN Connections
When you create multiple Site-to-Site VPN connections to a single VPC, you can configure a second
customer gateway to create a redundant connection to the same external location. You can also use it to
create Site-to-Site VPN connections to multiple geographic locations.
18
AWS Site-to-Site VPN User Guide
Multiple Site-to-Site VPN
Connections with a Transit Gateway
When you create multiple Site-to-Site VPN connections to a single VPC, you can configure a second
customer gateway to create a redundant connection to the same external location. You can also use it to
create Site-to-Site VPN connections to multiple geographic locations.
The following diagram shows the VPN CloudHub architecture, with blue dashed lines indicating network
traffic between remote sites being routed over their Site-to-Site VPN connections.
19
AWS Site-to-Site VPN User Guide
Secure Communication Between Sites Using VPN CloudHub
To use the AWS VPN CloudHub, you must create a virtual private gateway with multiple customer
gateways. You must use a unique Border Gateway Protocol (BGP) Autonomous System Number (ASN)
for each customer gateway. Customer gateways advertise the appropriate routes (BGP prefixes) over
their Site-to-Site VPN connections. These routing advertisements are received and re-advertised to each
BGP peer, enabling each site to send data to and receive data from the other sites. The sites must not
have overlapping IP ranges. Each site can also send and receive data from the VPC as if they were using a
standard Site-to-Site VPN connection.
Sites that use AWS Direct Connect connections to the virtual private gateway can also be part of the
AWS VPN CloudHub. For example, your corporate headquarters in New York can have an AWS Direct
Connect connection to the VPC and your branch offices can use Site-to-Site VPN connections to the VPC.
The branch offices in Los Angeles and Miami can send and receive data with each other and with your
corporate headquarters, all using the AWS VPN CloudHub.
To configure the AWS VPN CloudHub, you use the AWS Management Console to create multiple
customer gateways, each with the public IP address of the gateway and the ASN. Next, you create a Site-
to-Site VPN connection from each customer gateway to a common virtual private gateway. Each Site-to-
Site VPN connection must advertise its specific BGP routes. This is done using the network statements in
the VPN configuration files for the Site-to-Site VPN connection. The network statements differ slightly
depending on the type of router you use.
When using an AWS VPN CloudHub, you pay typical Amazon VPC Site-to-Site VPN connection rates. You
are billed the connection rate for each hour that each VPN is connected to the virtual private gateway.
When you send data from one site to another using the AWS VPN CloudHub, there is no cost to send
data from your site to the virtual private gateway. You only pay standard AWS data transfer rates for
data that is relayed from the virtual private gateway to your endpoint. For example, if you have a site
in Los Angeles and a second site in New York and both sites have a Site-to-Site VPN connection to the
virtual private gateway, you pay $.05 per hour for each Site-to-Site VPN connection (for a total of $.10
20
AWS Site-to-Site VPN User Guide
Using Redundant Site-to-Site VPN
Connections to Provide Failover
per hour). You also pay the standard AWS data transfer rates for all data that you send from Los Angeles
to New York (and vice versa) that traverses each Site-to-Site VPN connection; network traffic sent over
the Site-to-Site VPN connection to the virtual private gateway is free but network traffic sent over the
Site-to-Site VPN connection from the virtual private gateway to the endpoint is billed at the standard
AWS data transfer rate. For more information, see Site-to-Site VPN Connection Pricing.
The following diagram shows the two tunnels of each Site-to-Site VPN connection and two customer
gateways.
21
AWS Site-to-Site VPN User Guide
Using Redundant Site-to-Site VPN
Connections to Provide Failover
22
AWS Site-to-Site VPN User Guide
Using Redundant Site-to-Site VPN
Connections to Provide Failover
Dynamically routed Site-to-Site VPN connections use the Border Gateway Protocol (BGP) to exchange
routing information between your customer gateways and the virtual private gateways. Statically routed
Site-to-Site VPN connections require you to enter static routes for the remote network on your side of
the customer gateway. BGP-advertised and statically entered route information allow gateways on both
sides to determine which tunnels are available and reroute traffic if a failure occurs. We recommend that
you configure your network to use the routing information provided by BGP (if available) to select an
available path. The exact configuration depends on the architecture of your network.
23
AWS Site-to-Site VPN User Guide
Identifying a Site-to-Site VPN Connection
Contents
• Identifying a Site-to-Site VPN Connection (p. 24)
• Migrating from AWS Classic VPN to AWS VPN (p. 25)
• Testing the Site-to-Site VPN Connection (p. 26)
• Deleting a Site-to-Site VPN Connection (p. 27)
• Modifying a Site-to-Site VPN Connection's Target Gateway (p. 28)
• Modifying Site-to-Site VPN Tunnel Options (p. 31)
• Changing the Customer Gateway for a Site-to-Site VPN Connection (p. 32)
• Replacing Compromised Credentials (p. 32)
• Rotating Site-to-Site VPN Tunnel Endpoint Certificates (p. 33)
• You can use the describe-vpn-connections AWS CLI command. In the output that's returned, take
note of the Category value. A value of VPN indicates an AWS VPN connection. A value of VPN-
Classic indicates an AWS Classic VPN connection.
In the following example, the Site-to-Site VPN connection is an AWS VPN connection.
{
"VpnConnections": [
{
"VpnConnectionId": "vpn-1a2b3c4d",
...
"State": "available",
"VpnGatewayId": "vgw-11aa22bb",
"CustomerGatewayId": "cgw-ab12cd34",
"Type": "ipsec.1",
"Category": "VPN"
24
AWS Site-to-Site VPN User Guide
Migrating from AWS Classic VPN to AWS VPN
}
]
}
If your existing virtual private gateway is associated with multiple Site-to-Site VPN connections, you
must recreate each Site-to-Site VPN connection for the new virtual private gateway. If there are multiple
AWS Direct Connect private virtual interfaces attached to your virtual private gateway, you must recreate
each private virtual interface for the new virtual private gateway. For more information, see Creating a
Virtual Interface in the AWS Direct Connect User Guide.
If your existing Site-to-Site VPN connection is an AWS VPN connection, you cannot migrate to an AWS
Classic VPN connection.
Note
During this procedure, connectivity over the current VPC connection is interrupted when
you disable route propagation and detach the old virtual private gateway from your VPC.
Connectivity is restored when the new virtual private gateway is attached to your VPC and the
new Site-to-Site VPN connection is active. Ensure that you plan for the expected downtime.
• Virtual Private Gateway: Select the virtual private gateway that you created in the previous step.
• Customer Gateway: Choose Existing, and select the existing customer gateway for your current
AWS Classic VPN connection.
• Specify the routing options as required.
4. Select the new Site-to-Site VPN connection and choose Download Configuration. Download the
appropriate configuration file for your customer gateway device.
5. Use the configuration file to configure VPN tunnels on your customer gateway device. For examples,
see the Amazon VPC Network Administrator Guide. Do not enable the tunnels yet. Contact your
vendor if you need guidance on keeping the newly configured tunnels disabled.
6. (Optional) Create test VPC and attach the virtual private gateway to the test VPC. Change the
encryption domain/source destination addresses as required, and test connectivity from a host in
your local network to a test instance in the test VPC.
7. If you are using route propagation for your route table, choose Route Tables in the navigation pane.
Select the route table for your VPC, and choose Route Propagation, Edit. Clear the check box for the
old virtual private gateway and choose Save.
25
AWS Site-to-Site VPN User Guide
Testing the Site-to-Site VPN Connection
Note
From this step onwards, connectivity is interrupted until the new virtual private gateway is
attached and the new Site-to-Site VPN connection is active.
8. In the navigation pane, choose Virtual Private Gateways. Select the old virtual private gateway
and choose Actions, Detach from VPC, Yes, Detach. Select the new virtual private gateway, and
choose Actions, Attach to VPC. Specify the VPC for your Site-to-Site VPN connection, and choose
Yes, Attach.
9. In the navigation pane, choose Route Tables. Select the route table for your VPC and do one of the
following:
• If you are using route propagation, choose Route Propagation, Edit. Select the new virtual private
gateway that's attached to the VPC and choose Save.
• If you are using static routes, choose Routes, Edit. Modify the route to point to the new virtual
private gateway, and choose Save.
10. Enable the new tunnels on your customer gateway device and disable the old tunnels. To bring the
tunnel up, you must initiate the connection from your local network.
If applicable, check your route table to ensure that the routes are being propagated. The routes
propagate to the route table when the status of the VPN tunnel is UP.
Note
If you need to revert to your previous configuration, detach the new virtual private gateway
and follow steps 8 and 9 to re-attach the old virtual private gateway and update your
routes.
11. If you no longer need your AWS Classic VPN connection and do not want to continue incurring
charges for it, remove the previous tunnel configurations from your customer gateway device, and
delete the Site-to-Site VPN connection. To do this, go to Site-to-Site VPN Connections, select the
Site-to-Site VPN connection, and choose Delete.
Important
After you've deleted the AWS Classic VPN connection, you cannot revert or migrate your
new AWS VPN connection back to an AWS Classic VPN connection.
26
AWS Site-to-Site VPN User Guide
Deleting a Site-to-Site VPN Connection
6. Select the Select an existing security group option, and then select the default group that you
modified earlier. Choose Review and Launch.
7. Review the settings that you've chosen. Make any changes that you need, and then choose Launch
to select a key pair and launch the instance.
8. After the instance is running, get its private IP address (for example, 10.0.0.4). The Amazon EC2
console displays the address as part of the instance's details.
9. From a computer in your network that is behind the customer gateway, use the ping command with
the instance's private IP address. A successful response is similar to the following:
ping 10.0.0.4
You can now use SSH or RDP to connect to your instance in the VPC. For more information about how
to connect to a Linux instance, see Connect to Your Linux Instance in the Amazon EC2 User Guide for
Linux Instances. For more information about how to connect to a Windows instance, see Connect to Your
Windows Instance in the Amazon EC2 User Guide for Windows Instances.
If you no longer require a customer gateway, you can delete it. You can't delete a customer gateway
that's being used in a Site-to-Site VPN connection.
27
AWS Site-to-Site VPN User Guide
Modifying a Site-to-Site VPN Connection's Target Gateway
If you no longer require a virtual private gateway for your VPC, you can detach it.
If you no longer require a detached virtual private gateway, you can delete it. You can't delete a virtual
private gateway that's still attached to a VPC.
28
AWS Site-to-Site VPN User Guide
Step 1: Create the Transit Gateway
The following tasks help you complete the migration to a new gateway.
Tasks
• Step 1: Create the Transit Gateway (p. 29)
• Step 2: Delete Your Static Routes (Required for a Static VPN Connection Migrating to a Transit
Gateway) (p. 29)
• Step 3: Migrate to a New Gateway (p. 30)
• Step 4: Update VPC Route Tables (p. 30)
• Step 5: Update the Transit Gateway Routing (Required When the New Gateway is a Transit
Gateway) (p. 31)
• Step 6: Update the Customer Gateway ASN (Required When the New Gateway has a Different ASN
from the Old Gateway) (p. 31)
If the new target gateway is a transit gateway, attach the VPCs to the transit gateway. For information
about VPC attachments, see Transit Gateway Attachments to a VPC in Amazon VPC Transit Gateways.
When you modify the target from a virtual private gateway to a transit gateway, you can optionally set
the transit gateway ASN to be the same value as the virtual private gateway ASN. If you choose to have
a different ASN, then you must set the ASN on your customer gateway device to the transit gateway
ASN. For more information, see the section called “Step 6: Update the Customer Gateway ASN (Required
When the New Gateway has a Different ASN from the Old Gateway)” (p. 31).
You must delete the static routes before you migrate to the new gateway.
Tip
Keep a copy of the static route before you delete it. You will need to add back these routes to
the transit gateway after the VPN connection migration is complete.
29
AWS Site-to-Site VPN User Guide
Step 3: Migrate to a New Gateway
[Virtual private gateway] For Target VPN Gateway ID, choose the virtual private gateway ID.
[Transit Gateway] For Target transit gateway ID, choose the transit gateway ID.
5. Choose Save.
Virtual private gateway with Transit gateway Add a route that points to the
propagated routes transit gateway ID.
Virtual private gateway with Virtual private gateway with There is no action required.
propagated routes propagated routes
Virtual gateway with propagated Virtual private gateway with Add an entry that contains the
routes static route new virtual private gateway ID.
Virtual gateway with static Transit gateway Update the VPC route table and
routes change the entry that contains
to the virtual private gateway ID
to the transit gateway ID.
Virtual gateway with static Virtual private gateway with Update the entry that points
routes static routes to the virtual private gateway
ID to be the new virtual private
gateway ID.
Virtual gateway with static Virtual private gateway with Delete the entry that contains
routes propagated routes the virtual private gateway ID.
30
AWS Site-to-Site VPN User Guide
Step 5: Update the Transit Gateway Routing (Required
When the New Gateway is a Transit Gateway)
Transit Gateway Virtual private gateway with Update the entry that contains
static routes the transit gateway to the
virtual private gateway ID.
Transit Gateway Virtual private gateway with Delete the entry that contains
propagated routes the transit gateway ID.
31
AWS Site-to-Site VPN User Guide
Changing the Customer Gateway
for a Site-to-Site VPN Connection
6. Choose Save.
To modify the VPN tunnel options using the command line or API
1. Delete the Site-to-Site VPN connection. For more information, see Deleting a Site-to-Site VPN
Connection (p. 27). You don't need to delete the VPC or the virtual private gateway.
2. Create a new Site-to-Site VPN connection and specify your own pre-shared keys for the tunnels or
let AWS generate new pre-shared keys for you. For more information, see Create a Site-to-Site VPN
Connection and Configure the Customer Gateway Device (p. 15).
3. Download the new configuration file.
32
AWS Site-to-Site VPN User Guide
Rotating Site-to-Site VPN Tunnel Endpoint Certificates
To change the certificate for the AWS side of the tunnel endpoint
• Rotate the certificate. For more information, see the section called “Rotating Site-to-Site VPN
Tunnel Endpoint Certificates” (p. 33).
1. Create a new certificate, For information about creating an ACM certificate, see Getting Started in
the AWS Certificate Manager User Guide.
2. Add the certificate to the customer gateway device.
33
AWS Site-to-Site VPN User Guide
IAM Policies for Your Site-to-Site VPN Connection
By default, IAM users do not have permission to create, view, or modify AWS resources. To allow an IAM
user to access resources, such as Site-to-Site VPN connections, virtual private gateways, and customer
gateways, and to perform tasks, you must:
• Create an IAM policy that grants the IAM user permission to use the specific resources and API actions
they need
• Attach the policy to the IAM user or the group to which the IAM user belongs
When you attach a policy to a user or group of users, it allows or denies the users permission to perform
the specified tasks on the specified resources.
To work with a Site-to-Site VPN connections, virtual private gateways, and customer gateways, one of
the following AWS managed policies might meet your needs:
• PowerUserAccess
• ReadOnlyAccess
• AmazonEC2FullAccess
• AmazonEC2ReadOnlyAccess
For more information about policies, see IAM Policies for Amazon EC2 in the Amazon EC2 User Guide.
The following actions support resource-level permissions for the VPN connection resource:
• ec2:CreateVpnConnection
• ec2:ModifyVpnConnection
• ec2:ModifyVpnTunnelOptions
34
AWS Site-to-Site VPN User Guide
IAM Policies for Your Site-to-Site VPN Connection
ec2:Phase1DHGroupNumbers
The Diffie-Hellman 2, 14, 15, 16, 17, 18, 22, Numeric
groups that are 23, 24
permitted for the VPN
tunnel for the phase 1
IKE negotiations.
ec2:Phase2DHGroupNumbers
The Diffie-Hellman 2, 5, 14, 15, 16, 17, 18, Numeric
groups that are 22, 23, 24
permitted for the VPN
tunnel for the phase 2
IKE negotiations.
ec2:Phase1EncryptionAlgorithms
The encryption AES128, AES256 String
algorithms that are
permitted for the VPN
tunnel for the phase 1
IKE negotiations.
ec2:Phase2EncryptionAlgorithms
The encryption AES128, AES256 String
algorithms that are
permitted for the VPN
tunnel for the phase 2
IKE negotiations.
ec2:Phase1IntegrityAlgorithms
The integrity SHA1, SHA2-256 String
algorithms that are
permitted for the VPN
tunnel for the phase 1
IKE negotiations.
ec2:Phase2IntegrityAlgorithms
The integrity SHA1, SHA2-256 String
algorithms that are
permitted for the VPN
tunnel for the phase 2
IKE negotiations.
35
AWS Site-to-Site VPN User Guide
IAM Policies for Your Site-to-Site VPN Connection
ec2:Phase1LifetimeSeconds
The lifetime in seconds An integer between 900 Numeric
for phase 1 of the IKE and 28,800.
negotiation.
ec2:Phase2LifetimeSeconds
The lifetime in seconds An integer between 900 Numeric
for phase 2 of the IKE and 3,600.
negotiation.
ec2:RekeyMarginTimeSeconds
The margin time before An integer from 60 and Numeric
the phase 2 lifetime above.
expires, during which
AWS performs an IKE
rekey.
You can allow or deny specific values for each supported condition key using IAM condition operators.
For more information, see IAM JSON Policy Elements: Condition in the IAM User Guide.
The following example policy enables users to create VPN connections, but only VPN connections with
static routing types.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "statement1",
"Effect": "Allow",
"Action": [
"ec2:CreateVpnConnection"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:RoutingType": [
"static"
]
}
}
}
]
36
AWS Site-to-Site VPN User Guide
Service-Linked Role
• acm:ExportCertificate
• acm:DescribeCertificatee
• acm:ListCertificates
• acm-pca:DescribeCertificateAuthority
For a Site-to-Site VPN user to create a service-linked role on your behalf, you must have the required
permissions. For information about service-linked roles, see Service-Linked Role Permissions in the IAM
User Guide.
You can delete this service-linked role only after you delete all customer gateways that have an
associated ACM private certificate. This ensures that you cannot inadvertently remove permission to
access your ACM certificates in use by Site-to-Site VPN connections.
You can use the IAM console, the IAM CLI, or the IAM API to delete service-linked roles. For information
about deleting service-linked roles, see Deleting a Service-Linked Role in the IAM User Guide.
After you delete AWSServiceRoleForVPCS2SVPN, Amazon VPC creates the role again for a customer
gateway with an associated ACM private certificate.
37
AWS Site-to-Site VPN User Guide
Monitoring Tools
The next step is to establish a baseline for normal VPN performance in your environment, by measuring
performance at various times and under different load conditions. As you monitor your VPN, store
historical monitoring data so that you can compare it with current performance data, identify normal
performance patterns and performance anomalies, and devise methods to address issues.
Contents
• Monitoring Tools (p. 38)
• Monitoring VPN Tunnels Using Amazon CloudWatch (p. 39)
Monitoring Tools
AWS provides various tools that you can use to monitor a Site-to-Site VPN connection. You can configure
some of these tools to do the monitoring for you, while some of the tools require manual intervention.
We recommend that you automate monitoring tasks as much as possible.
• Amazon CloudWatch Alarms – Watch a single metric over a time period that you specify, and perform
one or more actions based on the value of the metric relative to a given threshold over a number of
38
AWS Site-to-Site VPN User Guide
Manual Monitoring Tools
time periods. The action is a notification sent to an Amazon SNS topic. CloudWatch alarms do not
invoke actions simply because they are in a particular state; the state must have changed and been
maintained for a specified number of periods. For more information, see Monitoring VPN Tunnels
Using Amazon CloudWatch (p. 39).
• AWS CloudTrail Log Monitoring – Share log files between accounts, monitor CloudTrail log files in real
time by sending them to CloudWatch Logs, write log processing applications in Java, and validate that
your log files have not changed after delivery by CloudTrail. For more information, see Logging API
Calls Using AWS CloudTrail in the Amazon EC2 API Reference and Working with CloudTrail Log Files in
the AWS CloudTrail User Guide
39
AWS Site-to-Site VPN User Guide
Viewing VPN Tunnel CloudWatch Metrics
Metric Description
Units: Boolean
TunnelDataIn The bytes received through the VPN tunnel. Each metric
data point represents the number of bytes received
after the previous data point. Use the Sum statistic to
show the total number of bytes received during the
period.
Units: Bytes
TunnelDataOut The bytes sent through the VPN tunnel. Each metric
data point represents the number of bytes sent after
the previous data point. Use the Sum statistic to show
the total number of bytes sent during the period.
Units: Bytes
Dimension Description
VpnId Filters the metric data by the Site-to-Site VPN connection ID.
TunnelIpAddress Filters the metric data by the IP address of the tunnel for the virtual
private gateway.
Metrics are grouped first by the service namespace, and then by the various dimension combinations
within each namespace.
40
AWS Site-to-Site VPN User Guide
Creating CloudWatch Alarms to Monitor VPN Tunnels
For example, you can create an alarm that monitors the state of a VPN tunnel and sends a notification
when the tunnel state is DOWN for 3 consecutive 5-minute periods.
• Under Alarm Threshold, enter a name and description for your alarm. For Whenever, choose <=
and enter 0. Enter 3 for the consecutive periods.
• Under Actions, select an existing notification list or choose New list to create a new one.
• Under Alarm Preview, select a period of 5 minutes and specify a statistic of Maximum.
You can create an alarm that monitors the state of the Site-to-Site VPN connection. For example, you
can create an alarm that sends a notification when the status of one or both tunnels is DOWN for 1
consecutive 5-minute period.
• Under Alarm Threshold, enter a name and description for your alarm. For Whenever, choose <=
and enter 0 (or 0.5 for when at least one tunnel is down). Enter 1 for the consecutive periods.
• Under Actions, select an existing notification list or choose New list to create a new one.
• Under Alarm Preview, select a period of 5 minutes and specify a statistic of Maximum.
Alternatively, if you've configured your Site-to-Site VPN connection so that both tunnels are up,
you can specify a statistic of Minimum to send a notification when at least one tunnel is down.
You can also create alarms that monitor the amount of traffic coming in or leaving the VPN tunnel. For
example, the following alarm monitors the amount of traffic coming into the VPN tunnel from your
network, and sends a notification when the number of bytes reaches a threshold of 5,000,000 during a
15 minute period.
41
AWS Site-to-Site VPN User Guide
Creating CloudWatch Alarms to Monitor VPN Tunnels
• Under Alarm Threshold, enter a name and description for your alarm. For Whenever, choose >=
and enter 5000000. Enter 1 for the consecutive periods.
• Under Actions, select an existing notification list or choose New list to create a new one.
• Under Alarm Preview, select a period of 15 minutes and specify a statistic of Sum.
The following alarm monitors the amount of traffic leaving the VPN tunnel to your network, and sends a
notification when the number of bytes is less than 1,000,000 during a 15 minute period.
• Under Alarm Threshold, enter a name and description for your alarm. For Whenever, choose <=
and enter 1000000. Enter 1 for the consecutive periods.
• Under Actions, select an existing notification list or choose New list to create a new one.
• Under Alarm Preview, select a period of 15 minutes and specify a statistic of Sum.
For more examples of creating alarms, see Creating Amazon CloudWatch Alarms in the Amazon
CloudWatch User Guide.
42
AWS Site-to-Site VPN User Guide
Document History
The following table describes the AWS Site-to-Site VPN User Guide updates.
Modify AWS Site-to-Site VPN You can modify the options for August 29, 2019
tunnel options a VPN tunnel in a AWS Site-to-
Site VPN connection. You can
also configure additional tunnel
options. For more information,
see Site-to-Site VPN Tunnel
Options for Your Site-to-Site
VPN Connection (p. 4).
AWS Certificate Manager Private You can use a private certificate August 15, 2019
Certificate Authority private from AWS Certificate Manager
certificate support Private Certificate Authority to
authenticate your VPN. For more
information, see the section
called “Private Certificate from
AWS Certificate Manager Private
Certificate Authority” (p. 8).
You can modify the target You can modify the target December 18, 2018
gateway of AWS Site-to-Site gateway of AWS Site-to-Site
VPN connection VPN connection. For more
information, see the section
called “Modifying a Site-to-
Site VPN Connection's Target
Gateway” (p. 28).
Initial release This release separates the AWS December 18, 2018
Site-to-Site VPN (previously
known as AWS Managed VPN)
content from the Amazon VPC
User Guide.
43