How to connect to on-premise VPN from EC2? - amazon-web-services

I would like to run my Node application from EC2. But my application's database is in Client's location and I usually connect through Cisco AnyConnect VPN application.
I tried installing openconnect in the EC2, the moment I connect to the VPN, the instance goes out of my control. I understood this, because I no longer have control on the EC2 instance, since it's in the Client's VPN network. So I rebooted the EC2 to get back the access.
So how can I connect my Client's VPN from EC2 ?
Note: I cannot install or ask my client to configure anything on their end for this, they just provided their VPN connection details.

Create a Gateway in AWS. You can build an IPsec tunnel from AWS to a client's firewall using a site-to-site VPN.

Related

Need for Port Forwarding VPN?

I'm wondering if I need port forwarding compatible Vpn given my tasks below:
Ill be connecting to aws services such as documentDB and RDS while travelling.
As a result, I plan on purchasing a dedicated IP VPN, so I can work while travelling, and add my VPN's static IP address to AWS to grant me access.
I'm working with a java spring boot backend. It connects to the documentDB and RDS and performs CRUD operations.
Does my VPN need to be port forwarding compatible?
I'm planning to purchase NordVPN with a dedicated IP, but might have to look into other VPNs port forwarding is required.
Some AWS services are VPC only, i.e. accessible only from the same VPC network. One of those services is DocumentDB, in order to connect directly from your laptop you'll have to create an ssh tunnel and port forward.
Having said that, you could have a bastion host in AWS configured with the right access, ssh (Linux) or RDP (Windows) to it and connect from that host.
The other option is https://aws.amazon.com/vpn/

Can I connect my PC directly to the Google Cloud VPN

I run some web services running in Google Compute Engine. I want to secure them and make available only to my coallegues. I don't want to rely on web server security, so my idea was to configure a VPN with Google Cloud Platform.
My question may be silly, because I don't really know how VPN works. Is it possible to create a VPN in Google Cloud and connect to it directly from my laptop? I've tried to use "Hybrid Connectivity VPN" - but it allows only to connect to another VPN. When I make a tunnel, it asks me "Remote peer IP address". I don't have any on-premise VPN in my organization, also I am behind a NAT of my provider.
I know that that it could be possible in principle - once I've connected to VPN of my previous job. I've just used build-in Windows function "Add a VPN connection", inputed IP of the server and the secret. After that I could connect to the servers that were inside the corporate network.
Can I configure Google Cloud VPN to work in similar way?
Client-to-gateway(road warrior) setup is not supported by CloudVPN. For client-to-gateway scenarios, you can install and configure an IPSec VPN software, like Strongswan on a GCE VM and configure it for remote access. Users can than connect to this VPN server through VPN client and, after a secure tunnel established they can connect to all other VMs which are deployed inside the same network. With this setup, you can also configure NAT gateway and remove the public IP from other VMs. Configuring a NAT gateway is described in this article.
https://serverfault.com/questions/818101/does-gcp-support-p2s

Not able to access AWS EC2 instance when connected to VPN

I have set up an AWS EC2 server, and installed cassandra on it. I am successfully able to connect to cassandra and use it through my local machine using the public IP of my ec2 instance.
Now, I need to be connected to a VPN to continue with my work. But, after connecting to the VPN, I am not able to ssh into the ec2 server or access the installed cassandra.
My security group allows all traffic (IPv4 and IPv6).
I'm new to this, so any help would be appreciated. Thanks!

Is there a managed way to do P2S VPN in AWS?

I want to connect my (OSX) laptop to a VPC in AWS but I couldn't find a way to do this since I don't have a static IP.
Azure has managed P2S VPN: https://learn.microsoft.com/en-us/azure/vpn-gateway/point-to-site-about. Is there something like this in AWS?
You can stand up a virtual device (such as a CheckPoint firewall) in the VPC on an EC2 instance that has point to site VPN functionality. There are a number of AMI’s and quick starts for this available. You would also need a VPN client running on your laptop.
As an alternative, you can set up a bastion server and whitelist your IP. You can create a shell script that gets your IP and makes an AWS CLI call to update the security group with that value if it doesn’t exist. Then, log into the bastion and you’re in the VPC.
You can setup a client VPN under the VPC menu:
https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-working-endpoints.html
It will require to have server cert, as well as client certificates or a link to managed AD for authentication.

How to setup a connection to VPN from AWS EC2 instance?

I'm running an application in EC2 which needs to connect to an external service running in a VPN (a connection to third party network). I have the IP address and auth details (pre-shared key) through which to connect, but don't know how exactly to setup the connection. Do I need to install a VPN Client or is there any other way through AWS Console?
If you can share the steps/tutorial to set it up, it would be really helpful.
I've configured Site-Site VPN and can see two tunnels under the VPN Connection (both are DOWN right now). I've shared the VPN config file with the third party and they have asked my source IP address to be used for both the tunnels. I'm assuming the source IP will be the public IP of NAT Gateway attached to my VPC (since the servers don't have public IP assigned to them).
You can use the Site to Site VPN(AWS hardware VPN) configuration from Amazon Virtual Private Cloud to your On-Premise Network which do not require a separate VPN Client. After the configuration, you can access the Server in the VPN from its IP range.
Following AWS User Guides will take you through to configure a VPN Connection. Basic configuration is straight forward and AWS will also provide automated scripts to setup configuration in your OnPremise network.
General Introduction to VPN Options Available in AWS: VPN Connections
Guide with Details in Setting up VPN: Adding a Hardware Virtual Private Gateway to Your VPC
Step by Step Guide for Configuration: Setting Up the VPN Connection
You can set up a VPN client in your EC2 instance but also can connect your VPC to the VPN server using:
VPN Connections.
Adding a Hardware Virtual Private Gateway to Your VPC