Today we are setting up a VPN between an onsite SonicWall and AWS.

  1. Log into your AWS account and navigate to your VPC
  2. vpn01Scroll down and navigate to VPN Connections -> Customer Gateways
  3. Click on Create Customer Gateway
  4. Name it, configure the routing and assign it the external IP address of your SonicWall (IP of the WAN interface)
[<img class="aligncenter size-full wp-image-348" src="" alt="vpn02" width="715" height="344" srcset=" 715w, 300w" sizes="(max-width: 715px) 100vw, 715px" />](   5. Navigate to **VPN Connections** -> **Virtual Private Gateways** and create a new Virtual Private Gateway and attach it to the VPC
[<img class="aligncenter size-full wp-image-349" src="" alt="vpn03" width="592" height="165" srcset=" 592w, 300w" sizes="(max-width: 592px) 100vw, 592px" />](   6. Navigate to **VPN Connections** -> **VPN Connections

** Create a new VPN Connection.

[<img class="aligncenter size-full wp-image-350" src="" alt="vpn04" width="736" height="385" srcset=" 736w, 300w" sizes="(max-width: 736px) 100vw, 736px" />](   7. Go to ‘Route Tables’ and add the private local route
[<img class="aligncenter size-full wp-image-352" src="" alt="vpn05" width="821" height="375" srcset=" 821w, 300w" sizes="(max-width: 821px) 100vw, 821px" />](   8. If all worked fine so far, go back to **VPN Connections** and download the Config File for the SonicWall. It has to the generic one as there is no specific one for SonicWall.
[<img class="aligncenter size-full wp-image-353" src="" alt="vpn06" width="699" height="345" srcset=" 699w, 300w" sizes="(max-width: 699px) 100vw, 699px" />](   9. You are done in AWS for now. **Take a coffee brake&#8230;** :o)  10. Log into your SonicWall and navigate to:
**VPN** -> **Settings** -> **VPN Policies** -> **Add&#8230;**  11. <table>
      Setup a VPN:<br /> IPSec Primary Gatey: AWS Tunnel 1 IP<br /> Shared Secret, see downloaded generic documentation (open in word!)<br /> Local IKE: Ext IP from Sonicwall<br /> Peer IKE: Same as IPSec Gateway

[<img class="aligncenter size-full wp-image-355" src="" alt="vpn07" width="638" height="408" srcset=" 638w, 300w" sizes="(max-width: 638px) 100vw, 638px" />](</li> 

  * Setup the proposal accordingly:
    [<img class="aligncenter size-full wp-image-356" src="" alt="vpn08" width="623" height="476" srcset=" 623w, 300w" sizes="(max-width: 623px) 100vw, 623px" />](
  * Setup the Advances settings accordingly:
    [<img class="aligncenter size-full wp-image-357" src="" alt="vpn09" width="644" height="413" srcset=" 644w, 300w" sizes="(max-width: 644px) 100vw, 644px" />](
  * Go to **VPN** -> **Advanced** and disable **NAT Traversal**
    [<img class="aligncenter size-full wp-image-358" src="" alt="vpn10" width="402" height="169" srcset=" 402w, 300w" sizes="(max-width: 402px) 100vw, 402px" />](
  * Go to **Network** -> **Routing** and configure a new router for the VPN.
    [<img class="aligncenter size-full wp-image-359" src="" alt="vpn11" width="386" height="417" srcset=" 386w, 278w" sizes="(max-width: 386px) 100vw, 386px" />](
  * Go to **Firewall **-> **Access Rules** and create a new rule for the AWS VPN
    (**VPN** -> **LAN** and **LAN** -> **VPN)**
    [<img class="aligncenter size-full wp-image-360" src="" alt="vpn12" width="347" height="343" srcset=" 347w, 300w" sizes="(max-width: 347px) 100vw, 347px" />](
  * Check in both AWS and SonicWall that the tunnel is up and check the firewalls. Once that is done start pinging from local to AWS and vice versa to confirm all is good. 
    All done :o)</li> </ol>