How do I set up a site-to-site VPN between a QuWAN device and an AWS VPC?


Last modified date: 2025-09-22

Applicable Products

Hardware

  • QHora-301W
  • QHora-321
  • QHora-322
  • QMiroPlus-201W
  • QMiro-201W

Software

  • QuWAN Orchestrator
  • QuRouter 2.4.0 and later
  • An Amazon Web Services (AWS) account

Details

This tutorial explains how to configure a route-based VPN between a QuWAN SD-WAN device and an AWS virtual private cloud (VPC). In a route-based VPN, the QuWAN device establishes an IPsec tunnel to the AWS virtual private gateway, and traffic is routed between the on-premises network and the AWS VPC using defined route tables. Only QNAP routers that have been added to QuWAN Orchestrator can be used for this setup. QuWAN Orchestrator manages the tunnel, handles routing, and maintains connectivity, while AWS routes traffic through the virtual private gateway, allowing secure, continuous communication between your network and cloud resources.

The steps cover configuring AWS VPC components, creating and attaching VPN gateways, downloading the AWS VPN configuration file, and applying the corresponding settings in QuWAN Orchestrator.

Important
  • QuWAN site-to-site VPN only supports IKEv2.
  • Both devices (QuWAN device and AWS VPC) must use the same configuration settings for the VPN to function correctly.
  • Your QNAP device must be added to QuWAN Orchestrator before configuring the site-to-site VPN. To add your QNAP device to QuWAN Orchestrator, see the Configuration chapter in the QuWAN and QuWAN Orchestrator Web Help.
Warning

Implementing a site-to-site VPN introduces additional complexity to your network. Ensure you understand the security implications before enabling it.


Procedure

Note
AWS settings and interfaces may change over time. For the most up-to-date information, refer to the AWS documentation.

Create a site-to-site connection VPN between your QNAP router and an AWS virtual private cloud (VPC)

A. Create a virtual private cloud

  1. Log in to https://console.aws.amazon.com/vpc/.
    The VPC dashboard page appears.
  2. Click Create VPC.
    The Create VPC page appears.
  3. Under VPC settings, select VPC only.
  4. Optional: Specify a name tag for the VPC, for example: QNAP-RouteBasedVPN
  5. Under IPv4 CIDR block, select IPv4 CIDR manual input.
  6. Specify the IPv4 address in CIDR format (e.g., 10.20.10.0/24).
  7. Under IPv6 CIDR block, select No IPv6 CIDR block.
  8. Optional: Select a tenancy option.
    Note
    Select whether EC2 instances in this VPC should use shared servers (default) or servers dedicated only to your account.
  9. Define one or more tags to help identify your resources, and assign a value to each tag.
  10. Optional: Click Preview code to visualize the relationships between the configured VPC resources.
  11. Click Create VPC.
    AWS creates the VPC.

B. Create a subnet

  1. On the VPC dashboard side panel, go to Virtual private cloud > Subnets.
  2. Click Create subnet.The Create subnet page appears.
  3. Selected your VPC from the drop-down menu.
  4. Specify a name tag for the subnet.
  5. Optional: Select an availability zone from the drop-down menu, or keep No Preference to let AWS choose one.
  6. Specify the IPv4 subnet CIDR block.
  7. Optional: Define one or more tags to help identify the VPC subnet, and assign a value to each tag.
  8. Click Create subnet.

C. Create an internet gateway

  1. On the VPC dashboard side panel, go to Virtual private cloud > Internet gateways.
  2. Click Create internet gateway.
  3. Optional: Define one or more tags to help identify the VPC internet gateway, and assign a value to each tag.
  4. Specify a name tag for the internet gateway.
  5. Click Create internet gateway.
    AWS creates the internet gateway.
  6. Click Actions, and then click Attach to VPC.The Attach to VPC page appears.
  7. Click the search bar under Available VPCs, and then select the QuWAN VPC.
  8. Click Attach internet gateway.
    AWS attaches the configured internet gateway to the QuWAN VPC.

D. Add the internet gateway to the route table

  1. On the VPC dashboard side panel, go to Virtual private cloud > Route tables.
  2. Identify the route table associated with the QuWAN VPC.
  3. Click the route table ID.The route table page appears.
  4. Click Edit routes.
    The Edit routes page appears.
  5. Click Add route.
  6. Enter 0.0.0.0/0 as the destination.
  7. Click the drop-down menu under Target, and select Internet Gateway.
    A secondary field appears under Internet Gateway appears.
  8. Select the previously configured internet gateway from the drop-down menu.
  9. Click Save changes.
    AWS updates the route table.

E. Configure security groups for the VPC

  1. On the VPC dashboard side panel, go to Security > Security groups.
  2. Identify the security group associated with your VPC.
  3. Click the security group.
    The security group page appears.
  4. Click Edit inbound rules.The Edit inbound rules page appears.
  5. Click Add rule.
  6. Under Type, select All traffic.
  7. Under Source, select Anywhere-IPv4.
  8. Click Save rules.
    AWS adds the security group to the QuWAN VPC.

F. Configure virtual private network (VPN) settings

  1. On the VPC dashboard side panel, go to Virtual private network (VPN) > Virtual private gateways.
  2. Click Create virtual private gateway.
  3. Specify a name tag for the VPN.
  4. Under Autonomous System Number (ASN), select Amazon default ASN.
    Note
    The ASN (Autonomous System Number) identifies AWS in the VPN connection. The default value is 64512, but it can be changed if it conflicts with your network.
  5. Optional: Define one or more tags to help identify the VPC subnet, and assign a value to each tag.
  6. Click Create virtual private gateway.
    AWS creates the virtual private gateway.
  7. On the Virtual private gateways page, select the virtual private gateway you configured.
  8. Click Actions, and then click Attach to VPC.The Attach to VPC page appears.
  9. Click the search bar under Available VPCs, and then select the QuWAN VPC.
  10. Click Attach to VPC.
    AWS attaches the configured virtual private gateway to the QuWAN VPC.

G. Identify the LAN and WAN IP address of your QNAP router

  1. Log in to QuRouter.
  2. Go to the WAN settings page:
    • For QHora routers: Network > Physical Network Settings > WAN
    • For QMiro routers: Network > WAN and LAN > WAN
  3. Identify the active WAN interface.
  4. Copy the IP address provided for the WAN interface.
  5. Go to the LAN settings page:
    • For QHora routers: Network > Physical Network Settings > LAN
    • For QMiro routers: Network > WAN and LAN > LAN
  6. Identify the active LAN interface.
  7. Copy the IP address provided for the LAN interface.

H. Add the virtual private gateway to the route table

  1. On the VPC dashboard side panel, go to Virtual private cloud > Route tables.
  2. Identify the route table associated with the QuWAN VPC.
  3. Click the route table ID.
    The route table page appears.
  4. Click Edit routes.
    The Edit routes page appears.
  5. Click Add route.
  6. Enter the copied QuRouter LAN interface IP address with its subnet in CIDR notation as the destination.
  7. Click the drop-down menu under Target, and select Virtual Private Gateway.
    A secondary field appears appears under Internet Gateway.
  8. Select the previously configured virtual private gateway from the drop-down menu.
  9. Click Save changes.
    AWS updates the route table.

I. Create a customer gateway for the VPC

  1. On the VPC dashboard side panel, go to Virtual private network (VPN) > Customer gateways.
  2. Click Create customer gateway.
  3. Specify a name tag for the customer gateway.
  4. Enter the copied QuRouter WAN interface IP address in the IP address field.
  5. Optional: Click Add new tag to define one or more tags to help identify the customer gateway, and assign a value to each tag.
  6. Click Create customer gateway.

J. Create a site-to-site VPN connection

  1. On the VPC dashboard side panel, go to Virtual private network (VPN) > Site-to-site VPN connections.
  2. Click Create VPN connection.
  3. Specify a name tag for the VPN connection.
  4. Under Target gateway type, select Virtual private gateway.
  5. Select the pre-configured virtual private gateway from the drop-down menu.
  6. Under Customer gateway, select Existing.
  7. Select the pre-configured customer gateway from the drop-down menu.
  8. Under Routing options, select Static.
  9. Enter the QuRouter LAN interface IP address with its subnet in CIDR notation in the Add static IP prefix field.
  10. Optional: Configure the pre-shared key storage, local IPv4 network CIDR, remote IPv4 network CIDR fields.
  11. Optional: Configure the primary and secondary tunnel settings.
  12. Optional: Click Add new tag to define one or more tags to help identify the customer gateway, and assign a value to each tag.
    Note
    AWS creates the Site-to-Site VPN connection with the QNAP router. On the VPN Connections page, verify that the connection status changes to Available.

K. Download the site-to-site VPN configuration file

  1. On the VPC dashboard side panel, go to Virtual private network (VPN) > Site-to-site VPN connections.
  2. Identify the site-to-site VPN connection you created in the previous step.
  3. Select the VPN connection.
  4. Click Download configuration.
    The Download configuration window appears.
  5. Under Vendor, select Strongswan.
  6. Under IKE version, select ikev2.
  7. Click Download.
    The configuration file is downloaded in TXT format.
  8. Click X on the Download configuration window.

Launch an EC2 (Elastic Cloud Compute) instance in AWS

  1. Go to https://console.aws.amazon.com/ec2/.
  2. On the side panel, go to Instances > Instances.
  3. Locate the Launch instances section.
  4. Click Launch instance.
    The Launch an instance page appears.
  5. Specify a name tag for the instance.
  6. Under Application and OS Images (Amazon Machine Image), click Ubuntu.
  7. Under Key pair (login), click Create new key pair.
    The Create key pair window appears.
  8. Specify a name for the key pair.
  9. Under Key pair type, select RSA.
  10. Under Private key file format, select .pem.
  11. Click Create key pair.
    AWS downloads the key pair configuration file in the selected format.
  12. Select the previously configured key pair from the drop-down menu in the Key pair (login) section.
  13. Click Edit in the Network settings section.
  14. Under VPC - required, select the pre-configured VPC.
  15. Under Auto-assign public IP, select Enable.
  16. Under Firewall (security groups), select Select existing security group.
  17. Under Common security groups, select the previously configured security group.
  18. Optional: Configure the storage and advanced settings.
  19. Click Launch instance.
    AWS launches the EC2 instance.

Configure site-to-site VPN settings in QuWAN Orchestrator

    1. Log in to QuWAN Orchestrator using your QNAP ID credentials.
    2. Select your organization.
    3. Go to QuWAN Topology > Route-Based VPN.
    4. Click Create New Connection.
      The Create New Connection window appears.
    5. Configure the route-based VPN connection settings.
      SettingDescription
      Connection nameAssign a descriptive name (e.g., AWS Site-to-Site VPN).
      IPsec modeSelect Tunnel Mode.
      DeviceDesignate the appropriate hub for the connection.
      WAN interfaceEnter the desired WAN interface.
      Remote IP or IDSpecify the public IP address or hostname of the remote gateway device.
      Test Connection (Optional)Click to ping the device to confirm the connection.
      Pre-shared keyEstablish a strong pre-shared key, ensuring identical configuration on the remote gateway.
    6. Click Advanced Settings to configure the advanced route-based VPN connection settings.
      SettingUser ActionExample Value
      Internet Key Exchange (IKE)
      VersionSelect IKEv2.-
      Authentication algorithmSelect a robust authentication algorithm.AES-128
      EncryptionSelect a strong encryption method.AES-128
      DH groupSelect the DH group size to determine the key strength used during the Diffie-Hellman exchange.14
      Security Association (SA) lifetimeDefine the IKE Security Association (SA) duration to reduce cryptographic risks associated with key exposure.480
      Local ID (Optional)Enter a local ID if you are using a Dynamic DNS (DDNS) service for the route-based VPN connection.-
      Encapsulating Security Payload (ESP)
      Authentication algorithmSelect an authentication algorithm.SHA-256
      EncryptionSelect an encryption method.AES-128
      Enable Perfect Forward Secrecy (PFS)Enable to generate a new Diffie-Hellman (DH) key for each session, ensuring stronger security.-
      DH GroupSelect the DH group size to define the key strength for the VPN connection.14
      Security Association (SA) lifetimeDefine the SA lifetime duration to specify how long a security association remains valid before rekeying.60 minutes
      Enable Dead Peer Detection (DPD)Enable to identity and respond to peer device outages.-
      DPD timeoutSet the DPD timeout to define how long the device waits before considering the peer unresponsive.10 seconds
    7. Select a location setting to specify how the device’s position is determined:
      • Locate by IP Address: Automatically detects the location based on the device’s IP address.
      • Update by GPS coordinates: Requires users to manually provide the latitude and longitude values.
    8. Enable Enable NAT mode to ensure that the VPN connection functions properly even when NAT devices are present in the network.
    9. Specify the local tunnel IP address to facilitate NAT-traversal.
    10. Under Destination Configuration, click Add Subnet.
    11. Specify the internal subnet of the remote network you want to access.
    12. Click .
    13. Click Create.
      Note
      If the route-based VPN connection is successful, the Status field displays the Connected status.

Further Reading

Was this article helpful?

Thank you for your feedback.

Please tell us how this article can be improved:

If you want to provide additional feedback, please include it below.

Choose specification

      Show more Less

      Choose Your Country or Region

      back to top