A fully automated solution for setting up L2TP over IPSec VPN solution in AWS cloud.
- AWS account
- AWS access key
- AWS CLI
Clone the repository:
git clone git@github.com:mazay/aws-l2tp-vpn.git
Switch to the project directory:
cd aws-l2tp-vpn
Start the spinup_vpn.sh script and input details for your VPN setup, you can find the list of AWS regions here.
Please specify AWS region name in which you would like to host the VPN solution:
Have you configured the AWS CLI? [y/n]:
VPN username:
VPN password:
VPN passphrase:
This will create EC2 key pair for you and a CloudFormation stack containing the following resources:
- VPC
- Internet Gateway
- VPC Subnet
- VPC Route Table along with the default route
- EC2 Security Group allowing access to the following ports:
- TCP/UDP 500
- TCP/UDP 4500
- TCP 22022 - custom SSH port
- EC2 instance - the instance will be provisioned with the VPN server software
- Elastic IP
The overall hosting cost should be about $5, depending on the selected AWS region.
Start the teardown_vpn.sh which will delete the EC2 key pair and CloudFormation stack, please note that the stack deletion procedure on AWS side might take up to 10 minutes.
Please specify AWS region name in which you host the VPN solution:
Have you configured the AWS CLI? [y/n]: